biosc - diagnostics: isochrones and $A(Li)$ model comparison¶

In [1]:
string = 'work'
In [2]:
## to change directory:
## string_directory = 'path...'
In [3]:
from matplotlib.path import Path
import pymc as pm
import arviz as az
import bambi as bmb
import xarray as xr
import biosc
import biosc.preprocessing
import matplotlib.ticker as ticker

from pymc import HalfCauchy, Model, Normal, sample

import os
import matplotlib.cm as cm
from netCDF4 import Dataset as NetCDFFile
from scipy.stats import gaussian_kde

from biosc.preprocessing import Preprocessing
from biosc.bhm import BayesianModel
In [4]:
import models_test
In [5]:
Jmag_lbda = 12350.00
Hmag_lbda = 16620.00
Kmag_lbda = 21590.00
BP_lbda = 5109.71
G_lbda = 6217.59
RP_lbda = 7769.02
gmag_lbda = 4849.11
rmag_lbda = 6201.20
wmag_lbda = 6285.91
imag_lbda = 7534.96
zmag_lbda = 8674.20
ymag_lbda = 9627.79
In [6]:
import models_test
from models_test import plt, np, pd, pc, select_nearest_age

path_all = pc(string)
## to change directory:
## path_all = pc_other(string_directory)

import sys
sys.path.append(path_all)

import bmp
from bmp import BayesianModelPlots
In [7]:
path_all
Out[7]:
'/pcdisk/dalen/lgonzalez/OneDrive/Escritorio/CAB_INTA-CSIC/01-Doctorado/013-Jupyter/0134-biosc_env/'
In [8]:
plt.rcParams.update({'font.size': 14, 'axes.linewidth': 1, 'axes.edgecolor': 'k'})
plt.rcParams['font.family'] = 'serif'

Pleiades data¶

In [9]:
from models_test import PleiadesData
In [10]:
path_data = path_all + 'data/Pleiades_DANCe+GDR3+2MASS+PanSTARRS1+A_Li+Lbol.csv'
pleiades_data = PleiadesData(path_data)

data_obs_Pleiades = pleiades_data.data
In [11]:
data_obs_Pleiades
Out[11]:
source_id Mecayotl Olivares+2018 Meingast+2021 l b ra ra_error dec dec_error ... r_abs i_abs y_abs z_abs g_abs G-J G-RP BP-RP Lsun log(L/Lsun)
0 66787119410915072 True True True 166.210733 -23.276099 56.662143 0.014997 24.520108 0.009073 ... 7.418857 6.972857 6.525157 6.694857 8.224757 1.826829 0.810348 1.512766 0.155611 -0.807959
1 64977705525131904 True True True 167.014088 -24.105530 56.647305 0.018675 23.411531 0.012227 ... 8.549097 7.790097 7.159997 7.424497 9.772697 2.421177 1.006676 2.033531 0.076629 -1.115607
2 65195404530870144 True True True 166.401835 -23.959280 56.302660 0.187139 23.895691 0.137836 ... 14.008637 12.001337 10.590737 11.072637 15.369937 3.461519 1.369004 3.289309 NaN NaN
3 64942001460286080 True True True 167.530351 -23.713150 57.315181 0.117257 23.380170 0.079404 ... 13.164333 11.330633 10.050533 10.483733 14.439433 3.319764 1.337366 3.338682 0.007924 -2.101050
4 64433924008996224 True True True 167.187075 -25.469587 55.777180 0.158969 22.296886 0.108396 ... 13.654355 11.738355 10.399955 10.850355 15.065555 3.404532 1.361330 3.481064 0.006176 -2.209322
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
941 68045583484082048 True True True 164.243788 -25.259933 53.747213 0.023608 24.204450 0.018528 ... 9.355493 8.326793 7.636193 7.872993 10.560393 2.526645 1.083299 2.277171 0.052494 -1.279886
942 65113559634339200 True True True 165.803768 -25.252330 54.921665 0.014164 23.290687 0.010935 ... 4.161775 4.078775 4.069775 4.064775 4.429775 0.890571 0.437847 0.711143 1.683682 0.226260
943 64987876007763968 True True True 167.304764 -23.830079 57.063558 0.061383 23.434686 0.049673 ... 11.529959 10.045959 9.017459 9.351059 12.720659 3.020585 1.246986 2.865516 0.015930 -1.797787
944 71056252479453056 True True True 163.033014 -22.724805 54.616063 0.095418 26.856932 0.065394 ... 12.175861 10.479061 9.307561 9.688561 13.449461 3.192930 1.292702 3.159868 0.011978 -1.921621
945 65129506848731136 True True True 166.221501 -24.634561 55.676696 0.013654 23.502637 0.009224 ... 6.892914 6.468914 6.072914 6.199914 7.756914 1.825894 0.746666 1.346799 0.238297 -0.622882

946 rows × 100 columns

In [12]:
data_obs_Pleiades.columns
Out[12]:
Index(['source_id', 'Mecayotl', 'Olivares+2018', 'Meingast+2021', 'l', 'b',
       'ra', 'ra_error', 'dec', 'dec_error', 'parallax', 'parallax_error',
       'pmra', 'pmra_error', 'pmdec', 'pmdec_error', 'pmra_pmdec_corr',
       'ra_dec_corr', 'ra_parallax_corr', 'ra_pmra_corr', 'ra_pmdec_corr',
       'dec_parallax_corr', 'dec_pmra_corr', 'dec_pmdec_corr',
       'parallax_pmra_corr', 'parallax_pmdec_corr', 'g', 'bp', 'rp', 'e_g',
       'e_bp', 'e_rp', 'dr3_radial_velocity', 'dr3_radial_velocity_error',
       'ruwe', 'astrometric_excess_noise', 'astrometric_params_solved',
       'bp_rp', 'g_rp', 'Jmag', 'Hmag', 'Kmag', 'e_Jmag', 'e_Hmag', 'e_Kmag',
       'gmag', 'e_gmag', 'rmag', 'e_rmag', 'imag', 'e_imag', 'zmag', 'e_zmag',
       'ymag', 'e_ymag', 'Name', 'EPIC', 'RAJ2000', 'DEJ2000', 'Vmag', 'J-K',
       'Per', 'Amp', 'l_WLi', 'WLi', 'e_WLi', 'Teff', 'ALi', 'e_ALi', 'Bin',
       'SimbadName', 'Teff_x', 'logg', '[Fe/H]', 'A0', 'AG', 'ABP', 'ARP',
       'E(BP-RP)', 'Rad', 'Lib', 'angDist', 'distance', 'distance_modulus',
       'G_abs', 'BP_abs', 'RP_abs', 'J_abs', 'H_abs', 'K_abs', 'r_abs',
       'i_abs', 'y_abs', 'z_abs', 'g_abs', 'G-J', 'G-RP', 'BP-RP', 'Lsun',
       'log(L/Lsun)'],
      dtype='object')
In [13]:
data_obs_Pleiades['e_G'] = data_obs_Pleiades['e_g']
data_obs_Pleiades['e_RP'] = data_obs_Pleiades['e_rp']
data_obs_Pleiades['e_BP'] = data_obs_Pleiades['e_bp']
data_obs_Pleiades['e_J'] = data_obs_Pleiades['e_Jmag']
data_obs_Pleiades['e_K'] = data_obs_Pleiades['e_Kmag']
data_obs_Pleiades['e_H'] = data_obs_Pleiades['e_Hmag']
data_obs_Pleiades['e_r'] = data_obs_Pleiades['e_rmag']
data_obs_Pleiades['e_i'] = data_obs_Pleiades['e_imag']
data_obs_Pleiades['e_z'] = data_obs_Pleiades['e_zmag']
data_obs_Pleiades['e_y'] = data_obs_Pleiades['e_ymag']
data_obs_Pleiades['e_gmag'] = data_obs_Pleiades['e_gmag']
In [14]:
data_obs_Pleiades['Teff_x']
Out[14]:
0      4410.5390
1      3664.9885
2            NaN
3      3131.1300
4      3092.2827
         ...    
941    3602.4023
942    6055.7964
943    3315.6130
944    3214.3660
945    4741.1820
Name: Teff_x, Length: 946, dtype: float64
In [15]:
np.mean(data_obs_Pleiades['ALi'])
Out[15]:
2.227078431372549
In [16]:
#sigma = 5.67e-8  # W/m²/K⁴
solar_abundance = 1.05
e_solar_abundance = 0.10
Zsun = 0.01524
#Asplund et al. 2009

Models¶

In [17]:
from models_test import Models
In [18]:
models = Models()

PARSEC¶

In [19]:
parsec = models.PARSEC(path_all)
In [20]:
PARSEC_00 = parsec.get_dataframe()
PARSEC_00
Out[20]:
Zini MH logAge Mini int_IMF M/Ms logL logTe logg label ... wP1_i45 wP1_i50 wP1_i55 wP1_i60 wP1_i65 wP1_i70 wP1_i75 wP1_i80 wP1_i85 wP1_i90
0 0.01471 0.0 6.30103 0.090000 1.081690 0.090 -1.379 3.4384 3.477 0.0 ... 10.378 10.378 10.378 10.378 10.378 10.378 10.378 10.378 10.378 10.378
1 0.01471 0.0 6.30103 0.097813 1.152571 0.098 -1.307 3.4443 3.465 0.0 ... 10.112 10.112 10.112 10.112 10.112 10.112 10.112 10.112 10.112 10.112
2 0.01471 0.0 6.30103 0.100000 1.171106 0.100 -1.288 3.4459 3.462 0.0 ... 10.042 10.042 10.042 10.042 10.042 10.042 10.042 10.042 10.042 10.042
3 0.01471 0.0 6.30103 0.100258 1.173256 0.100 -1.286 3.4461 3.461 0.0 ... 10.035 10.035 10.035 10.035 10.035 10.035 10.035 10.035 10.035 10.035
4 0.01471 0.0 6.30103 0.109296 1.244379 0.109 -1.224 3.4508 3.455 0.0 ... 9.811 9.811 9.811 9.811 9.811 9.811 9.811 9.811 9.811 9.811
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
41620 0.01471 0.0 8.77597 2.692088 2.589498 2.690 2.284 3.6668 2.203 7.0 ... -0.810 -0.810 -0.810 -0.810 -0.810 -0.810 -0.810 -0.810 -0.810 -0.810
41621 0.01471 0.0 8.77597 2.692170 2.589500 2.690 2.276 3.6678 2.215 7.0 ... -0.793 -0.793 -0.793 -0.793 -0.793 -0.793 -0.793 -0.793 -0.793 -0.793
41622 0.01471 0.0 8.77597 2.692199 2.589501 2.690 2.250 3.6700 2.249 7.0 ... -0.737 -0.737 -0.737 -0.737 -0.737 -0.737 -0.737 -0.737 -0.737 -0.737
41623 0.01471 0.0 8.77597 2.692242 2.589502 2.690 2.217 3.6727 2.294 7.0 ... -0.663 -0.663 -0.663 -0.663 -0.663 -0.663 -0.663 -0.663 -0.663 -0.663
41624 0.01471 0.0 8.77597 2.692394 2.589505 2.690 2.213 3.6727 2.297 7.0 ... -0.653 -0.653 -0.653 -0.653 -0.653 -0.653 -0.653 -0.653 -0.653 -0.653

41625 rows × 312 columns

In [21]:
PARSEC_00_sun = parsec.get_dataframe(sun=True)
PARSEC_00_sun
Out[21]:
Zini MH logAge Mini int_IMF M/Ms logL logTe logg label ... wP1_i45 wP1_i50 wP1_i55 wP1_i60 wP1_i65 wP1_i70 wP1_i75 wP1_i80 wP1_i85 wP1_i90
0 0.00713 -0.3272 6.30103 0.090000 1.081690 0.090 -1.270 3.4655 3.477 0.0 ... 9.549 9.549 9.549 9.549 9.549 9.549 9.549 9.549 9.549 9.549
1 0.00713 -0.3272 6.30103 0.096622 1.142251 0.097 -1.208 3.4700 3.463 0.0 ... 9.346 9.346 9.346 9.346 9.346 9.346 9.346 9.346 9.346 9.346
2 0.00713 -0.3272 6.30103 0.099697 1.168569 0.100 -1.182 3.4720 3.458 0.0 ... 9.261 9.261 9.261 9.261 9.261 9.261 9.261 9.261 9.261 9.261
3 0.00713 -0.3272 6.30103 0.108216 1.236287 0.108 -1.115 3.4768 3.446 0.0 ... 9.047 9.047 9.047 9.047 9.047 9.047 9.047 9.047 9.047 9.047
4 0.00713 -0.3272 6.30103 0.113255 1.273161 0.113 -1.081 3.4794 3.442 0.0 ... 8.936 8.936 8.936 8.936 8.936 8.936 8.936 8.936 8.936 8.936
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
37339 0.00713 -0.3272 8.77597 2.546733 2.586173 2.546 2.300 3.6824 2.226 7.0 ... -0.889 -0.889 -0.889 -0.889 -0.889 -0.889 -0.889 -0.889 -0.889 -0.889
37340 0.00713 -0.3272 8.77597 2.546813 2.586175 2.546 2.297 3.6829 2.230 7.0 ... -0.886 -0.886 -0.886 -0.886 -0.886 -0.886 -0.886 -0.886 -0.886 -0.886
37341 0.00713 -0.3272 8.77597 2.546835 2.586176 2.546 2.279 3.6845 2.254 7.0 ... -0.845 -0.845 -0.845 -0.845 -0.845 -0.845 -0.845 -0.845 -0.845 -0.845
37342 0.00713 -0.3272 8.77597 2.546864 2.586176 2.546 2.255 3.6866 2.287 7.0 ... -0.789 -0.789 -0.789 -0.789 -0.789 -0.789 -0.789 -0.789 -0.789 -0.789
37343 0.00713 -0.3272 8.77597 2.547009 2.586180 2.546 2.235 3.6877 2.312 7.0 ... -0.743 -0.743 -0.743 -0.743 -0.743 -0.743 -0.743 -0.743 -0.743 -0.743

37344 rows × 312 columns

In [22]:
age = 0.120
PARSEC_00_120 = parsec.get_dataframe_by_age(age)
PARSEC_00_120
Out[22]:
Zini MH logAge Mini int_IMF M/Ms logL logTe logg label ... wP1_i55 wP1_i60 wP1_i65 wP1_i70 wP1_i75 wP1_i80 wP1_i85 wP1_i90 Teff Lsun
0 0.01471 0.0 8.08636 0.090000 1.081690 0.090 -2.818 3.4010 4.766 0.0 ... 14.470 14.470 14.470 14.470 14.470 14.470 14.470 14.470 2517.676928 0.001521
1 0.01471 0.0 8.08636 0.091255 1.093600 0.091 -2.808 3.4024 4.768 0.0 ... 14.445 14.445 14.445 14.445 14.445 14.445 14.445 14.445 2525.806055 0.001556
2 0.01471 0.0 8.08636 0.098871 1.161602 0.099 -2.744 3.4117 4.776 0.0 ... 14.267 14.267 14.267 14.267 14.267 14.267 14.267 14.267 2580.477044 0.001803
3 0.01471 0.0 8.08636 0.100000 1.171106 0.100 -2.735 3.4131 4.777 0.0 ... 14.229 14.229 14.229 14.229 14.229 14.229 14.229 14.229 2588.808942 0.001841
4 0.01471 0.0 8.08636 0.100865 1.178290 0.101 -2.729 3.4140 4.778 0.0 ... 14.205 14.205 14.205 14.205 14.205 14.205 14.205 14.205 2594.179362 0.001866
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
120 0.01471 0.0 8.08636 2.699229 2.589651 2.699 1.794 4.0560 4.252 1.0 ... 0.913 0.913 0.913 0.913 0.913 0.913 0.913 0.913 11376.272858 62.230029
121 0.01471 0.0 8.08636 2.800000 2.591712 2.800 1.862 4.0656 4.238 1.0 ... 0.792 0.792 0.792 0.792 0.792 0.792 0.792 0.792 11630.543233 72.777980
122 0.01471 0.0 8.08636 3.000000 2.595334 3.000 1.992 4.0829 4.207 1.0 ... 0.560 0.560 0.560 0.560 0.560 0.560 0.560 0.560 12103.194151 98.174794
123 0.01471 0.0 8.08636 3.181551 2.598173 3.181 2.105 4.0971 4.176 1.0 ... 0.356 0.356 0.356 0.356 0.356 0.356 0.356 0.356 12505.469461 127.350308
124 0.01471 0.0 8.08636 3.200000 2.598441 3.199 2.116 4.0984 4.172 1.0 ... 0.334 0.334 0.334 0.334 0.334 0.334 0.334 0.334 12542.958923 130.617089

125 rows × 314 columns

In [23]:
PARSEC_00_120['Y']
Out[23]:
0      0.2745
1      0.2745
2      0.2745
3      0.2745
4      0.2745
        ...  
120    0.2746
121    0.2746
122    0.2746
123    0.2746
124    0.2746
Name: Y, Length: 125, dtype: float64
In [24]:
PARSEC_00_sun_120 = parsec.get_dataframe_by_age(age, sun=True)
PARSEC_00_sun_120
Out[24]:
Zini MH logAge Mini int_IMF M/Ms logL logTe logg label ... wP1_i55 wP1_i60 wP1_i65 wP1_i70 wP1_i75 wP1_i80 wP1_i85 wP1_i90 Teff Lsun
0 0.00713 -0.3272 8.08636 0.090000 1.081690 0.090 -2.769 3.4339 4.849 0.0 ... 13.741 13.741 13.741 13.741 13.741 13.741 13.741 13.741 2715.813858 0.001702
1 0.00713 -0.3272 8.08636 0.090711 1.088470 0.091 -2.764 3.4346 4.850 0.0 ... 13.717 13.717 13.717 13.717 13.717 13.717 13.717 13.717 2720.194762 0.001722
2 0.00713 -0.3272 8.08636 0.096212 1.138659 0.096 -2.721 3.4400 4.855 0.0 ... 13.526 13.526 13.526 13.526 13.526 13.526 13.526 13.526 2754.228703 0.001901
3 0.00713 -0.3272 8.08636 0.099697 1.168569 0.100 -2.694 3.4436 4.857 0.0 ... 13.404 13.404 13.404 13.404 13.404 13.404 13.404 13.404 2777.154236 0.002023
4 0.00713 -0.3272 8.08636 0.105658 1.216707 0.106 -2.653 3.4488 4.862 0.0 ... 13.224 13.224 13.224 13.224 13.224 13.224 13.224 13.224 2810.606200 0.002223
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
160 0.00713 -0.3272 8.08636 3.026102 2.595767 3.025 2.093 4.1248 4.277 1.0 ... 0.568 0.568 0.568 0.568 0.568 0.568 0.568 0.568 13329.074642 123.879659
161 0.00713 -0.3272 8.08636 3.171499 2.598026 3.170 2.183 4.1354 4.250 1.0 ... 0.405 0.405 0.405 0.405 0.405 0.405 0.405 0.405 13658.405431 152.405275
162 0.00713 -0.3272 8.08636 3.181142 2.598167 3.180 2.189 4.1361 4.248 1.0 ... 0.394 0.394 0.394 0.394 0.394 0.394 0.394 0.394 13680.437931 154.525444
163 0.00713 -0.3272 8.08636 3.362140 2.600650 3.360 2.297 4.1477 4.210 1.0 ... 0.191 0.191 0.191 0.191 0.191 0.191 0.191 0.191 14050.765963 198.152703
164 0.00713 -0.3272 8.08636 3.368611 2.600733 3.366 2.301 4.1481 4.209 1.0 ... 0.184 0.184 0.184 0.184 0.184 0.184 0.184 0.184 14063.713158 199.986187

165 rows × 314 columns

In [25]:
PARSEC_00_sun_120['Y']
Out[25]:
0      0.2615
1      0.2615
2      0.2615
3      0.2615
4      0.2615
        ...  
160    0.2614
161    0.2614
162    0.2614
163    0.2614
164    0.2614
Name: Y, Length: 165, dtype: float64
In [26]:
PARSEC_iso_omega_00_Phot_dict, PARSEC_iso_omega_00_sun_Phot_dict = parsec._generate_dicts()

BT-Settl¶

In [27]:
path_models = path_all + 'data/BT-Settl_all_Myr_Gaia+2MASS+PanSTARRS.csv'
BTSettl_mod = models.BTSettl(path_models)
In [28]:
BTSettl = BTSettl_mod.get_dataframe()
BTSettl
Out[28]:
age_Gyr t(Gyr) M/Ms Teff log(L/Lsun) lg(g) R(Gcm) D Li G_abs ... J_abs H_abs K_abs g_abs r_abs i_abs y_abs z_abs A(Li) Lsun
0 0.001 0.001 0.010 2345.0 -2.70 3.57 18.99 1.00 1.0000 14.055 ... 9.328 8.770 8.353 17.937 17.095 13.757 12.125 11.009 3.300000 0.001995
1 0.001 0.001 0.015 2504.0 -2.42 3.58 22.90 1.00 1.0000 13.015 ... 8.667 8.135 7.751 16.291 15.787 12.540 11.155 10.214 3.300000 0.003802
2 0.001 0.001 0.020 2598.0 -2.25 3.59 26.11 1.00 1.0000 12.381 ... 8.238 7.710 7.347 15.366 14.935 11.827 10.566 9.722 3.300000 0.005623
3 0.001 0.001 0.030 2710.0 -1.98 3.57 32.78 1.00 1.0000 11.507 ... 7.582 7.054 6.720 14.194 13.747 10.885 9.754 9.006 3.300000 0.010471
4 0.001 0.001 0.040 2779.0 -1.81 3.57 37.62 0.99 1.0000 10.990 ... 7.188 6.652 6.338 13.512 13.061 10.339 9.275 8.580 3.300000 0.015488
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
833 10.000 10.000 0.500 3689.0 -1.43 4.78 33.05 0.00 0.0000 8.937 ... 6.589 5.944 5.721 10.162 9.297 8.342 7.936 7.713 -inf 0.037154
834 10.000 10.000 0.600 4013.0 -1.12 4.70 39.92 0.00 0.0000 7.960 ... 5.926 5.237 5.059 9.010 8.100 7.463 7.188 7.015 -inf 0.075858
835 10.000 10.000 0.700 4493.0 -0.79 4.63 46.43 0.00 0.0000 6.900 ... 5.244 4.614 4.490 7.754 6.870 6.537 6.392 6.271 -inf 0.162181
836 10.000 10.000 0.800 5002.0 -0.47 4.55 54.44 0.00 0.0000 5.925 ... 4.580 4.098 4.000 6.529 5.885 5.675 5.594 5.525 -inf 0.338844
837 10.000 10.000 0.900 5495.0 -0.12 4.42 67.60 0.00 0.0626 4.972 ... 3.860 3.490 3.410 5.422 4.944 4.804 4.769 4.741 2.096574 0.758578

838 rows × 22 columns

In [29]:
age = 0.120
BTSettl_120 = BTSettl_mod.get_dataframe_by_age(age)
BTSettl_120
Out[29]:
age_Gyr t(Gyr) M/Ms Teff log(L/Lsun) lg(g) R(Gcm) D Li G_abs ... J_abs H_abs K_abs g_abs r_abs i_abs y_abs z_abs A(Li) Lsun
488 0.12 0.12 0.020 1304.0 -4.41 4.56 8.58 0.0 1.0000 19.367000 ... 14.167 12.877 12.291 25.102 22.184 20.307 17.194 16.000 3.300000 0.000039
489 0.12 0.12 0.030 1779.0 -3.88 4.75 8.44 0.0 1.0000 18.128999 ... 12.882 11.710 10.977 22.719 19.781 17.869 16.276 15.153 3.300000 0.000132
490 0.12 0.12 0.040 2225.0 -3.46 4.84 8.79 0.0 1.0000 16.322999 ... 11.268 10.580 10.210 21.486 18.909 16.300 14.352 13.157 3.300000 0.000347
491 0.12 0.12 0.050 2471.0 -3.23 4.88 9.31 0.0 0.9970 15.099000 ... 10.655 10.068 9.746 19.253 17.727 14.750 13.173 12.261 3.298695 0.000589
492 0.12 0.12 0.060 2635.0 -3.06 4.91 9.89 0.0 0.9010 14.358000 ... 10.289 9.710 9.397 17.811 16.792 13.812 12.518 11.764 3.254725 0.000871
493 0.12 0.12 0.070 2757.0 -2.94 4.93 10.47 0.0 0.2440 13.784000 ... 10.011 9.431 9.125 16.576 15.826 13.134 12.043 11.410 2.687390 0.001148
494 0.12 0.12 0.072 2780.0 -2.91 4.93 10.59 0.0 0.1110 13.674000 ... 9.959 9.379 9.073 16.387 15.630 13.008 11.952 11.340 2.345323 0.001230
495 0.12 0.12 0.075 2810.0 -2.88 4.93 10.78 0.0 0.0171 13.533000 ... 9.884 9.304 9.001 16.173 15.393 12.851 11.833 11.247 1.532996 0.001318
496 0.12 0.12 0.080 2853.0 -2.83 4.94 11.08 0.0 0.0001 13.363000 ... 9.771 9.192 8.896 15.990 15.143 12.668 11.679 11.119 -0.700000 0.001479
497 0.12 0.12 0.090 2924.0 -2.74 4.94 11.69 0.0 0.0000 13.058000 ... 9.569 8.992 8.707 15.614 14.704 12.346 11.408 10.891 -inf 0.001820
498 0.12 0.12 0.100 2978.0 -2.67 4.95 12.25 0.0 0.0000 12.800000 ... 9.401 8.824 8.547 15.218 14.336 12.076 11.184 10.700 -inf 0.002138
499 0.12 0.12 0.200 3270.0 -2.19 4.93 17.62 0.0 0.0000 11.203000 ... 8.332 7.736 7.483 12.818 12.050 10.505 9.871 9.538 -inf 0.006457
500 0.12 0.12 0.300 3411.0 -1.91 4.90 22.28 0.0 0.0000 10.378000 ... 7.696 7.088 6.844 11.838 11.027 9.708 9.158 8.868 -inf 0.012303
501 0.12 0.12 0.400 3536.0 -1.68 4.86 26.97 0.0 0.0000 9.696000 ... 7.167 6.546 6.310 11.042 10.207 9.056 8.573 8.315 -inf 0.020893
502 0.12 0.12 0.500 3727.0 -1.42 4.78 33.02 0.0 0.0000 8.867000 ... 6.562 5.912 5.693 10.069 9.195 8.284 7.896 7.679 -inf 0.038019
503 0.12 0.12 0.600 4030.0 -1.15 4.73 38.33 0.0 0.0000 8.019000 ... 6.001 5.316 5.139 9.077 8.145 7.524 7.255 7.085 -inf 0.070795
504 0.12 0.12 0.700 4400.0 -0.88 4.68 43.93 0.0 0.0000 7.152000 ... 5.427 4.774 4.642 8.061 7.135 6.762 6.598 6.469 -inf 0.131826
505 0.12 0.12 0.800 4825.0 -0.61 4.63 49.66 0.0 0.0046 6.326000 ... 4.883 4.352 4.246 7.006 6.284 6.040 5.940 5.854 0.962758 0.245471
506 0.12 0.12 0.900 5208.0 -0.37 4.58 56.22 0.0 0.0822 5.641000 ... 4.399 3.967 3.877 6.174 5.604 5.426 5.366 5.315 2.214872 0.426580
507 0.12 0.12 1.000 5547.0 -0.16 4.52 63.41 0.0 0.3070 5.065000 ... 3.974 3.614 3.536 5.503 5.038 4.904 4.873 4.848 2.787138 0.691831
508 0.12 0.12 1.100 5889.0 0.05 4.45 71.63 0.0 0.5740 4.514000 ... 3.560 3.264 3.195 4.875 4.498 4.403 4.398 4.396 3.058912 1.122018
509 0.12 0.12 1.200 6172.0 0.24 4.39 80.96 0.0 0.7700 4.038000 ... 3.187 2.936 2.872 4.341 4.032 3.967 3.983 3.996 3.186491 1.737801
510 0.12 0.12 1.300 6455.0 0.41 4.33 90.19 0.0 0.8800 3.605000 ... 2.853 2.643 2.583 3.855 3.609 3.574 3.610 3.634 3.244483 2.570396
511 0.12 0.12 1.400 6767.0 0.56 4.29 97.82 0.0 0.9380 3.226000 ... 2.576 2.408 2.352 3.422 3.242 3.240 3.297 3.331 3.272203 3.630781

24 rows × 22 columns

In [30]:
min(BTSettl_120['Teff'])
Out[30]:
1304.0
In [31]:
max(BTSettl['Teff'])
Out[31]:
6768.0
In [32]:
BTSettl_Li_isochrones = BTSettl_mod.BTSettl_Li_isochrones
In [33]:
BTSettl_Li_isochrones.keys()
Out[33]:
dict_keys([0.001, 0.002, 0.003, 0.004, 0.005, 0.006, 0.007, 0.008, 0.009000000000000001, 0.01, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.1, 0.12, 0.15, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7000000000000001, 0.8, 0.9, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0])
In [34]:
len(BTSettl_Li_isochrones.keys())
Out[34]:
39
In [35]:
BTSettl_Li_isochrones = {round(key, 3): value for key, value in BTSettl_Li_isochrones.items()}
BTSettl_Li_isochrones.keys()
Out[35]:
dict_keys([0.001, 0.002, 0.003, 0.004, 0.005, 0.006, 0.007, 0.008, 0.009, 0.01, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.1, 0.12, 0.15, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0])
In [36]:
len(BTSettl_Li_isochrones.keys())
Out[36]:
39
In [37]:
BTSettl_Li_isochrones_Teff = BTSettl_Li_isochrones[0.120][BTSettl_Li_isochrones[0.120]['Teff'] < 2955]
BTSettl_Li_isochrones_Teff = BTSettl_Li_isochrones_Teff[BTSettl_Li_isochrones_Teff ['Teff'] > 1600]
BTSettl_Li_isochrones_Teff
Out[37]:
age_Gyr t(Gyr) M/Ms Teff log(L/Lsun) lg(g) R(Gcm) D Li G_abs ... J_abs H_abs K_abs g_abs r_abs i_abs y_abs z_abs A(Li) Lsun
489 0.12 0.12 0.030 1779.0 -3.88 4.75 8.44 0.0 1.0000 18.128999 ... 12.882 11.710 10.977 22.719 19.781 17.869 16.276 15.153 3.300000 0.000132
490 0.12 0.12 0.040 2225.0 -3.46 4.84 8.79 0.0 1.0000 16.322999 ... 11.268 10.580 10.210 21.486 18.909 16.300 14.352 13.157 3.300000 0.000347
491 0.12 0.12 0.050 2471.0 -3.23 4.88 9.31 0.0 0.9970 15.099000 ... 10.655 10.068 9.746 19.253 17.727 14.750 13.173 12.261 3.298695 0.000589
492 0.12 0.12 0.060 2635.0 -3.06 4.91 9.89 0.0 0.9010 14.358000 ... 10.289 9.710 9.397 17.811 16.792 13.812 12.518 11.764 3.254725 0.000871
493 0.12 0.12 0.070 2757.0 -2.94 4.93 10.47 0.0 0.2440 13.784000 ... 10.011 9.431 9.125 16.576 15.826 13.134 12.043 11.410 2.687390 0.001148
494 0.12 0.12 0.072 2780.0 -2.91 4.93 10.59 0.0 0.1110 13.674000 ... 9.959 9.379 9.073 16.387 15.630 13.008 11.952 11.340 2.345323 0.001230
495 0.12 0.12 0.075 2810.0 -2.88 4.93 10.78 0.0 0.0171 13.533000 ... 9.884 9.304 9.001 16.173 15.393 12.851 11.833 11.247 1.532996 0.001318
496 0.12 0.12 0.080 2853.0 -2.83 4.94 11.08 0.0 0.0001 13.363000 ... 9.771 9.192 8.896 15.990 15.143 12.668 11.679 11.119 -0.700000 0.001479
497 0.12 0.12 0.090 2924.0 -2.74 4.94 11.69 0.0 0.0000 13.058000 ... 9.569 8.992 8.707 15.614 14.704 12.346 11.408 10.891 -inf 0.001820

9 rows × 22 columns

In [38]:
BTSettl_Li_isochrones_Teff['BP_abs']-BTSettl_Li_isochrones_Teff['RP_abs']
Out[38]:
489    4.853999
490    5.589999
491    5.210000
492    4.732000
493    4.146000
494    4.050000
495    3.950000
496    3.889000
497    3.759000
dtype: float64

MIST¶

In [39]:
mist_instance = models.MIST(path_all)

phot = 'UBVRIplus'
feh = 'm0.25'
vvcrit = 0.0

mist_instance.file_copy(phot, vvcrit, feh)

phot_G2 = 'UBVRIplus'
phot_P = 'PanSTARRS'
feh = 'p0.00'
vvcrit = 0.0

MIST_FULL = mist_instance.read_iso(phot_G2, phot_P, vvcrit, feh)

phot_G2 = 'UBVRIplus'
phot_P = 'PanSTARRS'
feh = 'p0.25'
vvcrit = 0.0

MIST_FULL_2 = mist_instance.read_iso(phot_G2, phot_P, vvcrit, feh)

desired_age = 0.120
nearest_age = select_nearest_age(MIST_FULL, desired_age)
MIST_FULL[nearest_age]
Reading in: /pcdisk/dalen/lgonzalez/OneDrive/Escritorio/CAB_INTA-CSIC/01-Doctorado/013-Jupyter/0134-biosc_env/data/MIST_v1.2_feh_p0.00_afe_p0.0_vvcrit0.0_PanSTARRS.iso.cmd
Reading in: /pcdisk/dalen/lgonzalez/OneDrive/Escritorio/CAB_INTA-CSIC/01-Doctorado/013-Jupyter/0134-biosc_env/data/MIST_v1.2_feh_p0.00_afe_p0.0_vvcrit0.0_UBVRIplus.iso.cmd
Reading in: /pcdisk/dalen/lgonzalez/OneDrive/Escritorio/CAB_INTA-CSIC/01-Doctorado/013-Jupyter/0134-biosc_env/data/MIST_v1.2_vvcrit0.0_full_isos/MIST_v1.2_feh_p0.00_afe_p0.0_vvcrit0.0_full.iso
version:  {'MIST': '1.2', 'MESA': '7503'}
abundances:  {'Yinit': 0.2703, 'Zinit': 0.0142857, '[Fe/H]': 0.0, '[a/Fe]': 0.0}
rotation:  0.0
Reading in: /pcdisk/dalen/lgonzalez/OneDrive/Escritorio/CAB_INTA-CSIC/01-Doctorado/013-Jupyter/0134-biosc_env/data/MIST_v1.2_feh_p0.25_afe_p0.0_vvcrit0.0_PanSTARRS.iso.cmd
Reading in: /pcdisk/dalen/lgonzalez/OneDrive/Escritorio/CAB_INTA-CSIC/01-Doctorado/013-Jupyter/0134-biosc_env/data/MIST_v1.2_feh_p0.25_afe_p0.0_vvcrit0.0_UBVRIplus.iso.cmd
Reading in: /pcdisk/dalen/lgonzalez/OneDrive/Escritorio/CAB_INTA-CSIC/01-Doctorado/013-Jupyter/0134-biosc_env/data/MIST_v1.2_vvcrit0.0_full_isos/MIST_v1.2_feh_p0.25_afe_p0.0_vvcrit0.0_full.iso
version:  {'MIST': '1.2', 'MESA': '7503'}
abundances:  {'Yinit': 0.2869, 'Zinit': 0.0254039, '[Fe/H]': 0.25, '[a/Fe]': 0.0}
rotation:  0.0
Out[39]:
EEP log10_isochrone_age_yr initial_mass M/Ms log_Teff log_g log_L [Fe/H]_init [Fe/H] g ... Gaia_BP_MAWf Gaia_RP_MAW TESS G BP RP phase surface_li7 Teff Lsun
0 153 8.1 0.100000 0.100000 3.472358 4.943898 -2.661675 0.0 0.041367 15.182353 ... 14.818656 11.510085 11.390598 12.816993 14.800249 11.507612 -1.0 4.509661e-20 2967.276575 0.002179
1 154 8.1 0.100487 0.100487 3.472502 4.943863 -2.659350 0.0 0.041366 15.172418 ... 14.808554 11.503003 11.383737 12.809403 14.790139 11.500522 -1.0 4.626529e-20 2968.258909 0.002191
2 155 8.1 0.104821 0.104821 3.473925 4.943235 -2.637765 0.0 0.041366 15.077920 ... 14.712386 11.436582 11.319491 12.737943 14.693890 11.434015 -1.0 5.808929e-20 2977.999206 0.002303
3 156 8.1 0.109198 0.109198 3.475536 4.942625 -2.615297 0.0 0.041368 14.976478 ... 14.609145 11.366608 11.251957 12.662225 14.590545 11.363955 -1.0 7.267820e-20 2989.068594 0.002425
4 157 8.1 0.113606 0.113606 3.477285 4.942037 -2.592188 0.0 0.041368 14.870311 ... 14.501178 11.294242 11.182213 12.583573 14.482453 11.291506 -1.0 9.055154e-20 3001.132776 0.002557
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
357 1706 8.1 4.873859 0.879580 4.653539 8.391392 -0.440251 0.0 0.097281 9.765747 ... 9.720577 10.274443 10.278122 9.957335 9.783835 10.293779 6.0 4.627805e-19 45033.880846 0.362869
358 1707 8.1 4.875869 0.879720 4.645607 8.393120 -0.473640 0.0 0.097241 9.789981 ... 9.745432 10.297119 10.300766 9.981316 9.808478 10.316435 6.0 4.579056e-19 44218.761646 0.336016
359 1708 8.1 4.878084 0.879874 4.637685 8.394857 -0.506986 0.0 0.097196 9.814415 ... 9.770496 10.319976 10.323583 10.005491 9.833328 10.339262 6.0 4.529060e-19 43419.503570 0.311182
360 1709 8.1 4.880514 0.880044 4.629777 8.396619 -0.540296 0.0 0.097147 9.839218 ... 9.795950 10.343163 10.346726 10.030030 9.858564 10.362416 6.0 4.457822e-19 42636.017717 0.288207
361 1710 8.1 4.883200 0.880231 4.621878 8.398361 -0.573538 0.0 0.097092 9.864440 ... 9.821851 10.366711 10.370228 10.054979 9.884237 10.385928 6.0 4.363275e-19 41867.616468 0.266970

362 rows × 45 columns

[Fe/H] for Pleiades: +0.042 (Soderblom et al. 2009).

In [40]:
MIST_FULL[nearest_age].columns
Out[40]:
Index(['EEP', 'log10_isochrone_age_yr', 'initial_mass', 'M/Ms', 'log_Teff',
       'log_g', 'log_L', '[Fe/H]_init', '[Fe/H]', 'g', 'r', 'i', 'z', 'y', 'w',
       'PS_open', 'phase', 'Bessell_U', 'Bessell_B', 'Bessell_V', 'Bessell_R',
       'Bessell_I', 'J', 'H', 'K', 'Kepler_Kp', 'Kepler_D51', 'Hipparcos_Hp',
       'Tycho_B', 'Tycho_V', 'Gaia_G_DR2Rev', 'Gaia_BP_DR2Rev',
       'Gaia_RP_DR2Rev', 'Gaia_G_MAW', 'Gaia_BP_MAWb', 'Gaia_BP_MAWf',
       'Gaia_RP_MAW', 'TESS', 'G', 'BP', 'RP', 'phase', 'surface_li7', 'Teff',
       'Lsun'],
      dtype='object')
In [41]:
plt.rcParams.update({'font.size': 14})  # Set the font size


fig, ax = plt.subplots(1, 1, figsize=(8, 6))

ax.set_ylabel('Mass Fraction Li')
ax.set_xlabel('$T_{eff}$ [K]')

ax.plot(10**MIST_FULL[nearest_age]['log_Teff'], MIST_FULL[nearest_age]['surface_li7'])

ax.set_xlim(2500, 10000)

ax.invert_xaxis()
No description has been provided for this image
In [42]:
max(10**MIST_FULL[nearest_age]['log_Teff'])
Out[42]:
339646.6795258933
In [43]:
min(10**MIST_FULL[nearest_age]['log_Teff'])
Out[43]:
2967.2765754069314
In [44]:
minTeff_array = []

for key in MIST_FULL.keys():
    minTeff = min(10**MIST_FULL[key]['log_Teff'])
    minTeff_array.append(minTeff)
    
min(minTeff_array)
Out[44]:
2885.5722587919586

SPOTS¶

In [45]:
plt.rcParams.update({'font.size': 11, 'axes.linewidth': 1, 'axes.edgecolor': 'k'})
plt.rcParams['font.family'] = 'serif'
In [46]:
spots_instance = models.SPOTS(path_all)
SPOTS = spots_instance.SPOTS
In [47]:
SPOTS.keys()
Out[47]:
dict_keys(['f017', 'f085', 'f051', 'f034', 'f068', 'f000'])
In [48]:
SPOTS['f000'].keys()
Out[48]:
dict_keys([0.001, 0.002, 0.003, 0.004, 0.005, 0.006, 0.007, 0.008, 0.009, 0.01, 0.011, 0.013, 0.014, 0.016, 0.018, 0.02, 0.022, 0.025, 0.028, 0.032, 0.035, 0.04, 0.045, 0.05, 0.056, 0.063, 0.071, 0.079, 0.089, 0.1, 0.112, 0.126, 0.141, 0.158, 0.178, 0.2, 0.224, 0.251, 0.282, 0.316, 0.355, 0.398, 0.447, 0.501, 0.562, 0.631, 0.708, 0.794, 0.891, 1.0, 1.122, 1.259, 1.413, 1.585, 1.778, 1.995, 2.239, 2.512, 2.818, 3.162, 3.548, 3.981])
In [49]:
SPOTS['f000'][0.126].columns
Out[49]:
Index(['Mass', 'Fspot', 'Xspot', 'log(L/Lsun)', 'log(R/Rsun)', 'log(g)',
       'log(Teff)', 'log(T_hot)', 'log(T_cool)', 'TauCZ', 'Li/Li0', 'B_mag',
       'V_mag', 'Rc_mag', 'Ic_mag', 'J_mag', 'H_mag', 'K_mag', 'W1_mag',
       'G_mag', 'BP_mag', 'RP_mag', 'Age [Gyr]', 'A(Li)', 'M/Ms', 'Teff',
       'Lsun', 'G', 'BP', 'RP'],
      dtype='object')
In [50]:
SPOTS['f085'][0.035]['BP_mag']-SPOTS['f085'][0.035]['RP_mag']
Out[50]:
0        NaN
1        NaN
2        NaN
3        NaN
4        NaN
5        NaN
6        NaN
7        NaN
8        NaN
9        NaN
10    2.5453
11    2.4617
12    2.3605
13    2.1510
14    1.8895
15    1.6275
16    1.3964
17    1.2118
18    1.0748
19    0.9690
20    0.9308
21    0.8991
22    0.8394
23    0.7704
24    0.6691
dtype: float64
In [51]:
SPOTS['f085'][0.035]['Li/Li0']
Out[51]:
0     0.99994
1     0.99501
2     0.91175
3     0.44079
4     0.01100
5     0.00002
6     0.00020
7     0.00404
8     0.03503
9     0.13395
10    0.29661
11    0.46932
12    0.61882
13    0.72710
14    0.79927
15    0.84324
16    0.87046
17    0.89569
18    0.91984
19    0.94082
20    0.95712
21    0.96947
22    0.97850
23    0.98504
24    0.98964
Name: Li/Li0, dtype: float64
In [52]:
fig, ax = plt.subplots(1, 1, figsize=(8, 6))

ax.set_ylabel('$Li/Li^0$')
ax.set_xlabel('$B_p-R_p$ [mag]')
ax.plot(SPOTS['f000'][0.025]['BP_mag']-SPOTS['f000'][0.025]['RP_mag'], SPOTS['f000'][0.025]['Li/Li0'], linewidth=1, label='SPOTS f000; 25 Myr')
ax.plot(SPOTS['f017'][0.006]['BP_mag']-SPOTS['f017'][0.006]['RP_mag'], SPOTS['f017'][0.006]['Li/Li0'], linewidth=1, label='SPOTS f017; 6 Myr')
ax.plot(SPOTS['f034'][0.010]['BP_mag']-SPOTS['f034'][0.010]['RP_mag'], SPOTS['f034'][0.010]['Li/Li0'], linewidth=1, label='SPOTS f034; 10 Myr')
ax.plot(SPOTS['f051'][0.016]['BP_mag']-SPOTS['f051'][0.016]['RP_mag'], SPOTS['f051'][0.016]['Li/Li0'], linewidth=1, label='SPOTS f051; 16 Myr')
ax.plot(SPOTS['f068'][0.028]['BP_mag']-SPOTS['f068'][0.028]['RP_mag'], SPOTS['f068'][0.028]['Li/Li0'], linewidth=1, label='SPOTS f068; 28 Myr')
ax.plot(SPOTS['f085'][0.035]['BP_mag']-SPOTS['f085'][0.035]['RP_mag'], SPOTS['f085'][0.035]['Li/Li0'], linewidth=1, label='SPOTS f085; 35 Myr')
ax.plot(SPOTS['f000'][0.126]['BP_mag']-SPOTS['f000'][0.126]['RP_mag'], SPOTS['f000'][0.126]['Li/Li0'], linewidth=1, linestyle='--', label='SPOTS f000; 126 Myr')



#ax.errorbar(data_obs_Pleiades['Teff'], data_obs_Pleiades['ALi'], yerr=data_obs_Pleiades['e_ALi'], fmt='.', zorder=0, color='r', elinewidth=1, capsize=2)
ax.legend(fontsize=12, loc='upper center', bbox_to_anchor=(1.25, 0.9))
Out[52]:
<matplotlib.legend.Legend at 0x7fd70745e450>
No description has been provided for this image
In [53]:
fig, ax = plt.subplots(1, 1, figsize=(8, 6))

ax.set_ylabel('$Li/Li^0$')
ax.set_xlabel('$G-R_p$ [mag]')
ax.plot(SPOTS['f000'][0.025]['G_mag']-SPOTS['f000'][0.025]['RP_mag'], np.log10(SPOTS['f000'][0.025]['Li/Li0'])+3.3, linewidth=1, label='SPOTS f000; 25 Myr')
ax.plot(SPOTS['f017'][0.006]['G_mag']-SPOTS['f017'][0.006]['RP_mag'], np.log10(SPOTS['f017'][0.006]['Li/Li0'])+3.3, linewidth=1, label='SPOTS f017; 6 Myr')
ax.plot(SPOTS['f034'][0.010]['G_mag']-SPOTS['f034'][0.010]['RP_mag'], np.log10(SPOTS['f034'][0.010]['Li/Li0'])+3.3, linewidth=1, label='SPOTS f034; 10 Myr')
ax.plot(SPOTS['f051'][0.016]['G_mag']-SPOTS['f051'][0.016]['RP_mag'], np.log10(SPOTS['f051'][0.016]['Li/Li0'])+3.3, linewidth=1, label='SPOTS f051; 16 Myr')
ax.plot(SPOTS['f068'][0.028]['G_mag']-SPOTS['f068'][0.028]['RP_mag'], np.log10(SPOTS['f068'][0.028]['Li/Li0'])+3.3, linewidth=1, label='SPOTS f068; 28 Myr')
ax.plot(SPOTS['f085'][0.035]['G_mag']-SPOTS['f085'][0.035]['RP_mag'], np.log10(SPOTS['f085'][0.035]['Li/Li0'])+3.3, linewidth=1, label='SPOTS f085; 35 Myr')
ax.plot(SPOTS['f000'][0.126]['G_mag']-SPOTS['f000'][0.126]['RP_mag'], np.log10(SPOTS['f000'][0.126]['Li/Li0'])+3.3, linewidth=1, linestyle='--', label='SPOTS f000; 126 Myr')



ax.errorbar(data_obs_Pleiades['G_abs']-data_obs_Pleiades['RP_abs'], data_obs_Pleiades['ALi'], yerr=data_obs_Pleiades['e_ALi'], fmt='.', zorder=0, color='r', elinewidth=1, capsize=2)
ax.legend(fontsize=12, loc='upper center', bbox_to_anchor=(1.25, 0.9))
/pcdisk/dalen/lgonzalez/OneDrive/Escritorio/CAB_INTA-CSIC/01-Doctorado/013-Jupyter/0134-biosc_env/biosc_env/lib64/python3.11/site-packages/pandas/core/arraylike.py:399: RuntimeWarning: divide by zero encountered in log10
  result = getattr(ufunc, method)(*inputs, **kwargs)
Out[53]:
<matplotlib.legend.Legend at 0x7fd7276c9210>
No description has been provided for this image
In [54]:
fig, ax = plt.subplots(1, 1, figsize=(8, 6))

ax.set_ylabel('$G$ [mag]')
ax.set_xlabel('$B_p-R_p$ [mag]')

ax.plot(SPOTS['f000'][0.126]['BP_mag']-SPOTS['f000'][0.126]['RP_mag'], SPOTS['f000'][0.126]['G_mag'], linewidth=1, label='SPOTS f000; 126 Myr', color='k')

ax.plot(SPOTS['f051'][0.126]['BP_mag']-SPOTS['f051'][0.126]['RP_mag'], SPOTS['f051'][0.126]['G_mag'], linewidth=1, linestyle='--', label='SPOTS f051; 126 Myr', color='k')

ax.plot(SPOTS['f085'][0.126]['BP_mag']-SPOTS['f085'][0.126]['RP_mag'], SPOTS['f085'][0.126]['G_mag'], linewidth=1, linestyle=':', label='SPOTS f085; 126 Myr', color='k')


ax.errorbar(data_obs_Pleiades['BP_abs']-data_obs_Pleiades['RP_abs'], data_obs_Pleiades['G_abs'], yerr=data_obs_Pleiades['e_g'], fmt='.', zorder=0, color='r', elinewidth=1, capsize=2, alpha=0.125)
ax.legend(fontsize=12, loc='upper center', bbox_to_anchor=(1.25, 0.9))
ax.invert_yaxis()
No description has been provided for this image
In [55]:
fig, ax = plt.subplots(1, 1, figsize=(8, 6))

ax.set_ylabel('$G$ [mag]')
ax.set_xlabel('$G-J$ [mag]')

ax.plot(SPOTS['f000'][0.126]['G_mag']-SPOTS['f000'][0.126]['J_mag'], SPOTS['f000'][0.126]['G_mag'], linewidth=1, label='SPOTS f000; 126 Myr', color='k')

ax.plot(SPOTS['f051'][0.126]['G_mag']-SPOTS['f051'][0.126]['J_mag'], SPOTS['f051'][0.126]['G_mag'], linewidth=1, linestyle='--', label='SPOTS f051; 126 Myr', color='k')

ax.plot(SPOTS['f085'][0.126]['G_mag']-SPOTS['f085'][0.126]['J_mag'], SPOTS['f085'][0.126]['G_mag'], linewidth=1, linestyle=':', label='SPOTS f085; 126 Myr', color='k')


ax.errorbar(data_obs_Pleiades['G_abs']-data_obs_Pleiades['J_abs'], data_obs_Pleiades['G_abs'], yerr=data_obs_Pleiades['e_g'], fmt='.', zorder=0, color='r', elinewidth=1, capsize=2, alpha=0.125)
ax.legend(fontsize=12, loc='upper center', bbox_to_anchor=(1.25, 0.9))
ax.invert_yaxis()
No description has been provided for this image
In [56]:
Tsun = 5772
In [57]:
fig, ax = plt.subplots(1, 1, figsize=(8, 6))

ax.set_ylabel('$A(Li)$ [dex]')
ax.set_xlabel('$T_{eff}$ [K]')
ax.plot(10**SPOTS['f000'][0.126]['log(Teff)'], SPOTS['f000'][0.126]['A(Li)'], linewidth=1, label='SPOTS f000')
ax.plot(10**SPOTS['f017'][0.126]['log(Teff)'], SPOTS['f017'][0.126]['A(Li)'], linewidth=1, label='SPOTS f017')
ax.plot(10**SPOTS['f034'][0.126]['log(Teff)'], SPOTS['f034'][0.126]['A(Li)'], linewidth=1, label='SPOTS f034')
ax.plot(10**SPOTS['f051'][0.126]['log(Teff)'], SPOTS['f051'][0.126]['A(Li)'], linewidth=1, label='SPOTS f051')

ax.errorbar(Tsun, solar_abundance, xerr=0.5, yerr=e_solar_abundance, fmt='.', zorder=2, color='b', elinewidth=1, capsize=0)

ax.plot(BTSettl_Li_isochrones[5]['Teff'], BTSettl_Li_isochrones[5]['A(Li)'], linewidth=1, linestyle='--', color='b')

ax.plot(BTSettl_Li_isochrones[0.120]['Teff'], BTSettl_Li_isochrones[0.120]['A(Li)'], linewidth=1, label='BT-Settl', linestyle='--', color='k')
ax.errorbar(data_obs_Pleiades['Teff'], data_obs_Pleiades['ALi'], yerr=data_obs_Pleiades['e_ALi'], fmt='.', zorder=0, color='r', elinewidth=1, capsize=2)
ax.legend(fontsize=12)
ax.invert_xaxis()
No description has been provided for this image
In [58]:
fig, ax = plt.subplots(1, 1, figsize=(8, 6))

ax.set_ylabel('$A(Li)$ [dex]')
ax.set_xlabel('G-J [mag]')
ax.plot(SPOTS['f000'][0.126]['G_mag']-SPOTS['f000'][0.126]['J_mag'], SPOTS['f000'][0.126]['A(Li)'], linewidth=1, label='SPOTS f000')
ax.plot(SPOTS['f017'][0.126]['G_mag']-SPOTS['f000'][0.126]['J_mag'], SPOTS['f017'][0.126]['A(Li)'], linewidth=1, label='SPOTS f017')
ax.plot(SPOTS['f034'][0.126]['G_mag']-SPOTS['f000'][0.126]['J_mag'], SPOTS['f034'][0.126]['A(Li)'], linewidth=1, label='SPOTS f034')
ax.plot(SPOTS['f051'][0.126]['G_mag']-SPOTS['f000'][0.126]['J_mag'], SPOTS['f051'][0.126]['A(Li)'], linewidth=1, label='SPOTS f051')



ax.plot(BTSettl_Li_isochrones[0.120]['G_abs']-BTSettl_Li_isochrones[0.120]['J_abs'], BTSettl_Li_isochrones[0.120]['A(Li)'], linewidth=1, label='BT-Settl', linestyle='--', color='k')
ax.errorbar(data_obs_Pleiades['g']-data_obs_Pleiades['Jmag'], data_obs_Pleiades['ALi'], yerr=data_obs_Pleiades['e_ALi'], fmt='.', zorder=0, color='r', elinewidth=1, capsize=2)
ax.legend(fontsize=12)
Out[58]:
<matplotlib.legend.Legend at 0x7fd71c291210>
No description has been provided for this image
In [59]:
data_obs_Pleiades[(~data_obs_Pleiades['ALi'].isnull()) & (data_obs_Pleiades['ALi'] != 0)]['ALi'].count()
Out[59]:
99
In [60]:
fig, ax = plt.subplots(1, 1, figsize=(8, 6))

ax.set_ylabel('$A(Li)$ [dex]')
ax.set_xlabel('G-J [mag]')
ax.plot(SPOTS['f017'][0.126]['G_mag']-SPOTS['f017'][0.126]['J_mag'], SPOTS['f017'][0.126]['A(Li)'], linewidth=1, label='SPOTS')
ax.plot(BTSettl_Li_isochrones[0.120]['G_abs']-BTSettl_Li_isochrones[0.120]['J_abs'], BTSettl_Li_isochrones[0.120]['A(Li)'], linewidth=1, label='BT-Settl')
ax.errorbar(data_obs_Pleiades['g']-data_obs_Pleiades['Jmag'], data_obs_Pleiades['ALi'], yerr=data_obs_Pleiades['e_ALi'], fmt='.', zorder=0, color='r', elinewidth=1, capsize=2)
ax.legend()
Out[60]:
<matplotlib.legend.Legend at 0x7fd713d49590>
No description has been provided for this image
In [61]:
max(10**SPOTS['f000'][0.126]['log(Teff)'])
Out[61]:
6512.426277507005
In [62]:
min(10**SPOTS['f000'][0.126]['log(Teff)'])
Out[62]:
2949.742462182295

BHAC15¶

In [63]:
file_path = path_all + 'data/BHAC15_iso.GAIA.txt'
BHAC15_dict = models.BHAC15.parse_file(file_path)


csv_file_path = path_all + 'data/BHAC15_iso.GAIA.csv'
models.BHAC15.save_to_csv(BHAC15_dict, file_path)

Corrected photometry SPOTS models¶

In [64]:
plt.rcParams.update({'font.size': 11, 'axes.linewidth': 1, 'axes.edgecolor': 'k'})
plt.rcParams['font.family'] = 'serif'
In [65]:
spots_instance = models.SPOTS_YBC(path_all)
SPOTS_edr3 = spots_instance.SPOTS_edr3
spots_f000_edr3 = spots_instance.spots_f000_edr3
In [66]:
desired_age = 0.120
nearest_age = select_nearest_age(SPOTS_edr3['00'], desired_age)
SPOTS_edr3['00'][nearest_age]
Out[66]:
logAge Mass Fspot Xspot log(L/Lsun) log(R/Rsun) log(g) log(Teff) log(T_hot) log(T_cool) ... G-J G-RP J-H H-K G-H G-K G-V A(Li) Lsun Teff
0 8.1 0.10 0.0 0.8 -2.689492 -0.761060 4.959872 3.469784 3.469784 0.0 ... 3.35304 1.30207 0.59756 0.26728 0.0 4.21788 -2.47892 -inf 0.002044 2949.742462
1 8.1 0.15 0.0 0.8 -2.395952 -0.669096 4.952036 3.497187 3.497187 0.0 ... 2.99943 1.20822 0.60105 0.25040 0.0 3.85088 -1.73221 -inf 0.004018 3141.861887
2 8.1 0.20 0.0 0.8 -2.201137 -0.599432 4.937648 3.511059 3.511059 0.0 ... 2.84699 1.16439 0.60451 0.24098 0.0 3.69248 -1.43388 -inf 0.006293 3243.838470
3 8.1 0.25 0.0 0.8 -2.050513 -0.543744 4.923181 3.520871 3.520871 0.0 ... 2.74490 1.13382 0.60821 0.23494 0.0 3.58805 -1.28022 -inf 0.008902 3317.959343
4 8.1 0.30 0.0 0.8 -1.925703 -0.496960 4.908773 3.528682 3.528682 0.0 ... 2.66759 1.11005 0.61198 0.23084 0.0 3.51041 -1.18325 -inf 0.011866 3378.171160
5 8.1 0.35 0.0 0.8 -1.810935 -0.454479 4.890757 3.536133 3.536133 0.0 ... 2.59808 1.08829 0.61570 0.22728 0.0 3.44106 -1.10319 -inf 0.015455 3436.631053
6 8.1 0.40 0.0 0.8 -1.690418 -0.414652 4.869095 3.546349 3.546349 0.0 ... 2.50653 1.05926 0.62064 0.22274 0.0 3.34991 -1.00765 -inf 0.020398 3518.427448
7 8.1 0.45 0.0 0.8 -1.560148 -0.373196 4.837337 3.558189 3.558189 0.0 ... 2.40336 1.02586 0.62677 0.21722 0.0 3.24735 -0.92722 -inf 0.027533 3615.667953
8 8.1 0.50 0.0 0.8 -1.414063 -0.329963 4.796627 3.573093 3.573093 0.0 ... 2.27286 0.98262 0.63555 0.20717 0.0 3.11558 -0.81893 -inf 0.038542 3741.906660
9 8.1 0.55 0.0 0.8 -1.268473 -0.291167 4.760429 3.590093 3.590093 0.0 ... 2.13329 0.93498 0.64821 0.18849 0.0 2.96999 -0.68095 -inf 0.053892 3891.281506
10 8.1 0.60 0.0 0.8 -1.152988 -0.260413 4.736709 3.603587 3.603587 0.0 ... 2.03715 0.90024 0.65799 0.16852 0.0 2.86366 -0.61492 -inf 0.070309 4014.089117
11 8.1 0.65 0.0 0.8 -1.012628 -0.226149 4.702943 3.621545 3.621545 0.0 ... 1.91598 0.85397 0.66084 0.14166 0.0 2.71848 -0.55648 -inf 0.097134 4183.549674
12 8.1 0.70 0.0 0.8 -0.864977 -0.195221 4.673272 3.642994 3.642994 0.0 ... 1.76134 0.79178 0.64193 0.11210 0.0 2.51537 -0.46759 -0.421246 0.136466 4395.352697
13 8.1 0.75 0.0 0.8 -0.728511 -0.169368 4.651529 3.664184 3.664184 0.0 ... 1.60323 0.72951 0.58685 0.09376 0.0 2.28384 -0.40592 1.075974 0.186848 4615.127249
14 8.1 0.80 0.0 0.8 -0.597804 -0.145327 4.631475 3.684840 3.684840 0.0 ... 1.46156 0.67394 0.51835 0.08276 0.0 2.06267 -0.34286 1.881039 0.252462 4839.938464
15 8.1 0.85 0.0 0.8 -0.474711 -0.121780 4.610710 3.703839 3.703839 0.0 ... 1.34257 0.62656 0.46092 0.07325 0.0 1.87674 -0.30101 2.349644 0.335189 5056.377615
16 8.1 0.90 0.0 0.8 -0.358181 -0.098047 4.588069 3.721106 3.721106 0.0 ... 1.24022 0.58621 0.41165 0.06548 0.0 1.71735 -0.26414 2.641553 0.438348 5261.455359
17 8.1 0.95 0.0 0.8 -0.246858 -0.073722 4.562899 3.736774 3.736774 0.0 ... 1.15234 0.55188 0.36945 0.05927 0.0 1.58106 -0.24622 2.831645 0.566424 5454.735418
18 8.1 1.00 0.0 0.8 -0.140140 -0.048660 4.535051 3.750922 3.750922 0.0 ... 1.07435 0.52027 0.33460 0.05284 0.0 1.46179 -0.22926 2.958403 0.724203 5635.369148
19 8.1 1.05 0.0 0.8 -0.037916 -0.022712 4.504345 3.763504 3.763504 0.0 ... 1.00962 0.49384 0.30534 0.04858 0.0 1.36354 -0.20177 3.047699 0.916397 5801.018360
20 8.1 1.10 0.0 0.8 0.060162 0.003835 4.471454 3.774750 3.774750 0.0 ... 0.94841 0.46791 0.27898 0.04458 0.0 1.27197 -0.17662 3.113608 1.148582 5953.197490
21 8.1 1.15 0.0 0.8 0.154305 0.029990 4.438448 3.785208 3.785208 0.0 ... 0.89284 0.44356 0.25601 0.04084 0.0 1.18969 -0.17206 3.162471 1.426608 6098.292624
22 8.1 1.20 0.0 0.8 0.244443 0.055355 4.406203 3.795061 3.795061 0.0 ... 0.84260 0.42131 0.23493 0.03804 0.0 1.11557 -0.16850 3.199054 1.755672 6238.221627
23 8.1 1.25 0.0 0.8 0.330458 0.079603 4.375435 3.804440 3.804440 0.0 ... 0.79458 0.39976 0.21466 0.03575 0.0 1.04499 -0.16294 3.226090 2.140217 6374.414055
24 8.1 1.30 0.0 0.8 0.412322 0.101930 4.347814 3.813743 3.813743 0.0 ... 0.74710 0.37807 0.19477 0.03369 0.0 0.97556 -0.15675 3.246089 2.584178 6512.426278

25 rows × 60 columns

In [67]:
SPOTS_edr3['85'][nearest_age]
Out[67]:
logAge Mass Fspot Xspot log(L/Lsun) log(R/Rsun) log(g) log(Teff) log(T_hot) log(T_cool) ... G-J G-RP J-H H-K G-H G-K G-V A(Li) Lsun Teff
0 8.1 0.10 0.847 0.8 -2.761755 -0.665781 4.769315 3.404079 3.479336 3.382426 ... 4.107711 1.451015 0.585361 0.295944 0.0 4.989016 -2.516235 2.244433 0.001731 2535.588947
1 8.1 0.15 0.847 0.8 -2.497531 -0.574975 4.763794 3.424732 3.499990 3.403080 ... 4.075011 1.437369 0.585551 0.295543 0.0 4.956105 -1.866302 -inf 0.003180 2659.084019
2 8.1 0.20 0.847 0.8 -2.314691 -0.509727 4.758237 3.437818 3.513075 3.416165 ... 4.010649 1.421087 0.586131 0.294935 0.0 4.891715 -1.554233 -inf 0.004845 2740.425311
3 8.1 0.25 0.847 0.8 -2.172126 -0.459132 4.753958 3.448162 3.523419 3.426509 ... 3.872527 1.393568 0.587446 0.293379 0.0 4.753352 -1.426080 -inf 0.006728 2806.479796
4 8.1 0.30 0.847 0.8 -2.049000 -0.416230 4.747312 3.457492 3.532750 3.435840 ... 3.733294 1.366071 0.588768 0.290341 0.0 4.612402 -1.356427 -inf 0.008933 2867.426272
5 8.1 0.35 0.847 0.8 -1.931932 -0.376595 4.734990 3.466942 3.542199 3.445289 ... 3.600167 1.338875 0.589996 0.286253 0.0 4.476416 -1.302754 -inf 0.011697 2930.501311
6 8.1 0.40 0.847 0.8 -1.809499 -0.338319 4.716429 3.478412 3.553670 3.456760 ... 3.439087 1.303660 0.591724 0.280542 0.0 4.311352 -1.260680 -inf 0.015506 3008.929900
7 8.1 0.45 0.847 0.8 -1.671891 -0.297670 4.686284 3.492490 3.567747 3.470837 ... 3.254961 1.260181 0.594213 0.271423 0.0 4.120597 -1.195125 -inf 0.021287 3108.062046
8 8.1 0.50 0.847 0.8 -1.501147 -0.253464 4.643629 3.513072 3.588330 3.491420 ... 2.995661 1.192625 0.601096 0.255155 0.0 3.851911 -0.991065 0.048188 0.031539 3258.910549
9 8.1 0.55 0.847 0.8 -1.289990 -0.212640 4.603374 3.545450 3.620707 3.523797 ... 2.677116 1.102191 0.622722 0.229291 0.0 3.529129 -0.728217 1.942069 0.051287 3511.151994
10 8.1 0.60 0.847 0.8 -1.103566 -0.197423 4.610728 3.584447 3.659705 3.562795 ... 2.323397 0.990639 0.643738 0.207503 0.0 3.174638 -0.534171 2.641929 0.078783 3841.026027
11 8.1 0.65 0.847 0.8 -1.035662 -0.190024 4.630692 3.597724 3.672981 3.576071 ... 2.206161 0.951923 0.648395 0.196717 0.0 3.051273 -0.470558 2.935574 0.092117 3960.258456
12 8.1 0.70 0.847 0.8 -0.893310 -0.162198 4.607226 3.619399 3.694656 3.597746 ... 2.039102 0.893324 0.663340 0.168677 0.0 2.871119 -0.380797 3.080684 0.127847 4162.927620
13 8.1 0.75 0.847 0.8 -0.749999 -0.133807 4.580406 3.641031 3.716288 3.619378 ... 1.891602 0.837590 0.663877 0.137911 0.0 2.693391 -0.337469 3.157947 0.177828 4375.532359
14 8.1 0.80 0.847 0.8 -0.619289 -0.104438 4.549698 3.659024 3.734282 3.637372 ... 1.761485 0.785528 0.648344 0.113136 0.0 2.522965 -0.304589 3.201491 0.240276 4560.623177
15 8.1 0.85 0.847 0.8 -0.494575 -0.073767 4.514684 3.674867 3.750125 3.653215 ... 1.643328 0.739492 0.612932 0.098517 0.0 2.354777 -0.292595 3.225745 0.320202 4730.064360
16 8.1 0.90 0.847 0.8 -0.375724 -0.041868 4.475710 3.688631 3.763888 3.666978 ... 1.544597 0.701406 0.568451 0.089794 0.0 2.202842 -0.267726 3.239739 0.420995 4882.368444
17 8.1 0.95 0.847 0.8 -0.261217 -0.009255 4.433965 3.700951 3.776208 3.679298 ... 1.460212 0.668364 0.525453 0.083907 0.0 2.069572 -0.246427 3.252158 0.548003 5022.854178
18 8.1 1.00 0.847 0.8 -0.150509 0.023071 4.391589 3.712464 3.787722 3.690812 ... 1.388522 0.639261 0.491256 0.077892 0.0 1.957670 -0.237135 3.263712 0.707116 5157.797769
19 8.1 1.05 0.847 0.8 -0.044366 0.054240 4.350440 3.723416 3.798673 3.701763 ... 1.321207 0.612244 0.458590 0.072423 0.0 1.852219 -0.227984 3.273507 0.902888 5289.511674
20 8.1 1.10 0.847 0.8 0.056709 0.083544 4.312036 3.734032 3.809290 3.712380 ... 1.258516 0.587548 0.427405 0.068161 0.0 1.754081 -0.213987 3.280966 1.139485 5420.412773
21 8.1 1.15 0.847 0.8 0.152666 0.109666 4.279098 3.744961 3.820219 3.723309 ... 1.196089 0.563002 0.397408 0.063248 0.0 1.656745 -0.207143 3.286534 1.421237 5558.543901
22 8.1 1.20 0.847 0.8 0.243698 0.131549 4.253815 3.756777 3.832035 3.735125 ... 1.130216 0.537072 0.366100 0.058241 0.0 1.554558 -0.198745 3.290561 1.752660 5711.855868
23 8.1 1.25 0.847 0.8 0.330066 0.148334 4.237973 3.769977 3.845234 3.748324 ... 1.059353 0.508874 0.333063 0.053028 0.0 1.445444 -0.187981 3.293454 2.138289 5888.121595
24 8.1 1.30 0.847 0.8 0.412044 0.152254 4.247167 3.788511 3.863769 3.766859 ... 0.962256 0.469227 0.289012 0.046617 0.0 1.297885 -0.164622 3.295477 2.582520 6144.850624

25 rows × 60 columns

In [68]:
SPOTS_edr3['34'][nearest_age]
Out[68]:
logAge Mass Fspot Xspot log(L/Lsun) log(R/Rsun) log(g) log(Teff) log(T_hot) log(T_cool) ... G-J G-RP J-H H-K G-H G-K G-V A(Li) Lsun Teff
0 8.1 0.10 0.339 0.8 -2.712418 -0.730690 4.899133 3.448868 3.473095 3.376185 ... 3.742510 1.367287 0.592289 0.279062 0.0 4.613860 -2.225280 -inf 0.001939 2811.043719
1 8.1 0.15 0.339 0.8 -2.429194 -0.639035 4.891914 3.473846 3.498074 3.401164 ... 3.552493 1.303907 0.593885 0.273108 0.0 4.419486 -1.452944 -inf 0.003722 2977.461880
2 8.1 0.20 0.339 0.8 -2.239438 -0.570778 4.880339 3.487157 3.511384 3.414474 ... 3.449597 1.270577 0.595468 0.270133 0.0 4.315199 -1.144710 -inf 0.005762 3070.130315
3 8.1 0.25 0.339 0.8 -2.093052 -0.516734 4.869161 3.496731 3.520959 3.424049 ... 3.346588 1.245101 0.597407 0.268085 0.0 4.212080 -1.002123 -inf 0.008071 3138.565164
4 8.1 0.30 0.339 0.8 -1.970007 -0.470971 4.856795 3.504611 3.528839 3.431929 ... 3.251364 1.223920 0.599437 0.266240 0.0 4.117042 -0.921175 -inf 0.010715 3196.032449
5 8.1 0.35 0.339 0.8 -1.855306 -0.429144 4.840087 3.512373 3.536600 3.439690 ... 3.164504 1.204025 0.601326 0.263619 0.0 4.029448 -0.853239 -inf 0.013954 3253.664509
6 8.1 0.40 0.339 0.8 -1.732767 -0.389883 4.819557 3.523377 3.547604 3.450694 ... 3.043895 1.175900 0.604096 0.259253 0.0 3.907245 -0.775352 -inf 0.018503 3337.158468
7 8.1 0.45 0.339 0.8 -1.598062 -0.348402 4.787747 3.536313 3.560540 3.463630 ... 2.903786 1.141178 0.607729 0.253016 0.0 3.764531 -0.716838 -inf 0.025231 3438.053813
8 8.1 0.50 0.339 0.8 -1.440761 -0.304085 4.744871 3.553480 3.577707 3.480797 ... 2.725873 1.093817 0.613757 0.240962 0.0 3.580592 -0.606917 -inf 0.036244 3576.675831
9 8.1 0.55 0.339 0.8 -1.270122 -0.264206 4.706506 3.576200 3.600427 3.503517 ... 2.512445 1.032694 0.626376 0.218399 0.0 3.357220 -0.474141 -inf 0.053688 3768.772046
10 8.1 0.60 0.339 0.8 -1.153239 -0.239203 4.694288 3.592919 3.617146 3.520236 ... 2.374117 0.990087 0.633704 0.201647 0.0 3.209468 -0.431123 -1.097940 0.070269 3916.686310
11 8.1 0.65 0.339 0.8 -1.031144 -0.210744 4.672133 3.609213 3.633441 3.536531 ... 2.241838 0.946093 0.637087 0.188190 0.0 3.067116 -0.360417 0.878639 0.093080 4066.430555
12 8.1 0.70 0.339 0.8 -0.876848 -0.181250 4.645329 3.633040 3.657268 3.560358 ... 2.047628 0.878765 0.628806 0.172535 0.0 2.848968 -0.299951 1.935785 0.132786 4295.761882
13 8.1 0.75 0.339 0.8 -0.736951 -0.157424 4.627641 3.656102 3.680329 3.583419 ... 1.868222 0.815837 0.611799 0.155998 0.0 2.636019 -0.230109 2.463906 0.183252 4530.035861
14 8.1 0.80 0.339 0.8 -0.605662 -0.132469 4.605759 3.676446 3.700674 3.603764 ... 1.731855 0.765344 0.601383 0.134222 0.0 2.467459 -0.192590 2.756017 0.247935 4747.295001
15 8.1 0.85 0.339 0.8 -0.481992 -0.107274 4.581698 3.694766 3.718994 3.622084 ... 1.618071 0.721858 0.583690 0.114929 0.0 2.316690 -0.163635 2.929287 0.329615 4951.834257
16 8.1 0.90 0.339 0.8 -0.364868 -0.081453 4.554880 3.711137 3.735364 3.638454 ... 1.514684 0.681663 0.561779 0.097240 0.0 2.173704 -0.159854 3.039105 0.431650 5142.056686
17 8.1 0.95 0.339 0.8 -0.252749 -0.054619 4.524694 3.725750 3.749977 3.653067 ... 1.421049 0.645613 0.528213 0.086146 0.0 2.035408 -0.159072 3.110233 0.558793 5318.017351
18 8.1 1.00 0.339 0.8 -0.144951 -0.026781 4.491293 3.738780 3.763008 3.666098 ... 1.341370 0.615109 0.490456 0.078869 0.0 1.910695 -0.147280 3.159421 0.716224 5479.993836
19 8.1 1.05 0.339 0.8 -0.041363 0.001673 4.455574 3.750450 3.774677 3.677767 ... 1.270744 0.587172 0.454556 0.073601 0.0 1.798901 -0.133883 3.194028 0.909154 5629.242268
20 8.1 1.10 0.339 0.8 0.058102 0.029655 4.419813 3.761325 3.785553 3.688643 ... 1.208803 0.561706 0.424804 0.068538 0.0 1.702145 -0.137937 3.219617 1.143146 5771.983488
21 8.1 1.15 0.339 0.8 0.153256 0.056658 4.385114 3.771612 3.795840 3.698930 ... 1.151474 0.538113 0.397171 0.063878 0.0 1.612523 -0.141929 3.239359 1.423167 5910.339933
22 8.1 1.20 0.339 0.8 0.243977 0.082324 4.352265 3.781460 3.805687 3.708777 ... 1.097759 0.516154 0.370454 0.060524 0.0 1.528737 -0.142472 3.255346 1.753789 6045.883439
23 8.1 1.25 0.339 0.8 0.330256 0.105689 4.323264 3.791347 3.815575 3.718665 ... 1.044562 0.494133 0.345278 0.056602 0.0 1.446442 -0.141702 3.267539 2.139224 6185.104762
24 8.1 1.30 0.339 0.8 0.412254 0.125899 4.299877 3.801741 3.825969 3.729059 ... 0.990369 0.471804 0.319197 0.053157 0.0 1.362724 -0.139495 3.276616 2.583771 6334.923139

25 rows × 60 columns

In [69]:
spots_f000_edr3.columns
Out[69]:
Index(['logAge', 'Mass', 'Fspot', 'Xspot', 'log(L/Lsun)', 'log(R/Rsun)',
       'log(g)', 'log(Teff)', 'log(T_hot)', 'log(T_cool)', 'TauCZ', 'Li/Li0',
       'B_mag', 'V_mag', 'Rc_mag', 'Ic_mag', 'J_mag', 'H_mag', 'K_mag',
       'W1_mag', 'G_mag', 'BP_mag', 'RP_mag', 'Thot', 'Tcool', 'Label_0',
       'J_hot', 'H_hot', 'Ks_hot', 'Label_1', 'J_cool', 'H_cool', 'Ks_cool',
       'Label_2', 'G_hot', 'G_BP_hot', 'G_RP_hot', 'Label_3', 'G_cool',
       'G_BP_cool', 'G_RP_cool'],
      dtype='object')
In [70]:
#for age in SPOTS_edr3['00'].keys():
#    print(age)
#    print(min(SPOTS_edr3['00'][age]['Teff']))
In [71]:
for f in SPOTS_edr3.keys():
    print(f)
00
17
34
51
68
85
In [72]:
SPOTS_edr3['00'].keys()
Out[72]:
dict_keys([0.001, 0.002, 0.003, 0.004, 0.005, 0.006, 0.007, 0.008, 0.009, 0.01, 0.011, 0.013, 0.014, 0.016, 0.018, 0.02, 0.022, 0.025, 0.028, 0.032, 0.035, 0.04, 0.045, 0.05, 0.056, 0.063, 0.071, 0.079, 0.089, 0.1, 0.112, 0.126, 0.141, 0.158, 0.178, 0.2, 0.224, 0.251, 0.282, 0.316, 0.355, 0.398, 0.447, 0.501, 0.562, 0.631, 0.708, 0.794, 0.891, 1.0, 1.122, 1.259, 1.413, 1.585, 1.778, 1.995, 2.239, 2.512, 2.818, 3.162, 3.548, 3.981])
In [73]:
SPOTS_edr3['00'][nearest_age].columns
Out[73]:
Index(['logAge', 'Mass', 'Fspot', 'Xspot', 'log(L/Lsun)', 'log(R/Rsun)',
       'log(g)', 'log(Teff)', 'log(T_hot)', 'log(T_cool)', 'TauCZ', 'Li/Li0',
       'B_mag', 'V_mag', 'Rc_mag', 'Ic_mag', 'J_mag', 'H_mag', 'K_mag',
       'W1_mag', 'G_mag', 'BP_mag', 'RP_mag', 'Thot', 'Tcool', 'Label_0',
       'J_hot', 'H_hot', 'Ks_hot', 'Label_1', 'J_cool', 'H_cool', 'Ks_cool',
       'Label_2', 'G_hot', 'G_BP_hot', 'G_RP_hot', 'Label_3', 'G_cool',
       'G_BP_cool', 'G_RP_cool', 'Age_Gyr', 'BP_abs', 'RP_abs', 'G_abs',
       'J_abs', 'H_abs', 'K_abs', 'M/Ms', 'BP-RP', 'G-J', 'G-RP', 'J-H', 'H-K',
       'G-H', 'G-K', 'G-V', 'A(Li)', 'Lsun', 'Teff'],
      dtype='object')
In [74]:
fig, ax = plt.subplots(1, 1, figsize=(8, 6))

ax.set_ylabel('$A(Li)$ [dex]')
ax.set_xlabel('$B_p-R_p$ [mag]')
ax.plot(SPOTS_edr3['00'][0.025]['BP-RP'], SPOTS_edr3['00'][0.025]['A(Li)'], linewidth=1, label='SPOTS-YBC f000; 25 Myr')
ax.plot(SPOTS_edr3['17'][0.006]['BP-RP'], SPOTS_edr3['17'][0.006]['A(Li)'], linewidth=1, label='SPOTS-YBC f017; 6 Myr')
ax.plot(SPOTS_edr3['34'][0.010]['BP-RP'], SPOTS_edr3['34'][0.010]['A(Li)'], linewidth=1, label='SPOTS-YBC f034; 10 Myr')
ax.plot(SPOTS_edr3['51'][0.016]['BP-RP'], SPOTS_edr3['51'][0.016]['A(Li)'], linewidth=1, label='SPOTS-YBC f051; 16 Myr')
ax.plot(SPOTS_edr3['68'][0.028]['BP-RP'], SPOTS_edr3['68'][0.028]['A(Li)'], linewidth=1, label='SPOTS-YBC f068; 28 Myr')
ax.plot(SPOTS_edr3['85'][0.035]['BP-RP'], SPOTS_edr3['85'][0.035]['A(Li)'], linewidth=1, label='SPOTS-YBC f085; 35 Myr')
ax.plot(SPOTS_edr3['00'][0.126]['BP-RP'], SPOTS_edr3['00'][0.126]['A(Li)'], linewidth=1, color = 'k', linestyle='--', label='SPOTS-YBC f000; 126 Myr')



ax.errorbar(data_obs_Pleiades['bp']-data_obs_Pleiades['rp'], data_obs_Pleiades['ALi'], yerr=data_obs_Pleiades['e_ALi'], fmt='.', zorder=0, color='r', elinewidth=1, capsize=2)
ax.legend(fontsize=12, loc='upper center', bbox_to_anchor=(1.25, 0.9))
Out[74]:
<matplotlib.legend.Legend at 0x7fd726796ad0>
No description has been provided for this image
In [75]:
fig, ax = plt.subplots(1, 1, figsize=(8, 6))

ax.set_ylabel('$A(Li)$ [dex]')
ax.set_xlabel('$G-J$ [mag]')
ax.plot(SPOTS_edr3['00'][0.025]['G-J'], SPOTS_edr3['00'][0.025]['A(Li)'], linewidth=1, label='SPOTS-YBC f000; 25 Myr')
ax.plot(SPOTS_edr3['17'][0.006]['G-J'], SPOTS_edr3['17'][0.006]['A(Li)'], linewidth=1, label='SPOTS-YBC f017; 6 Myr')
ax.plot(SPOTS_edr3['34'][0.010]['G-J'], SPOTS_edr3['34'][0.010]['A(Li)'], linewidth=1, label='SPOTS-YBC f034; 10 Myr')
ax.plot(SPOTS_edr3['51'][0.016]['G-J'], SPOTS_edr3['51'][0.016]['A(Li)'], linewidth=1, label='SPOTS-YBC f051; 16 Myr')
ax.plot(SPOTS_edr3['68'][0.028]['G-J'], SPOTS_edr3['68'][0.028]['A(Li)'], linewidth=1, label='SPOTS-YBC f068; 28 Myr')
ax.plot(SPOTS_edr3['85'][0.035]['G-J'], SPOTS_edr3['85'][0.035]['A(Li)'], linewidth=1, label='SPOTS-YBC f085; 35 Myr')
ax.plot(SPOTS_edr3['00'][0.126]['G-J'], SPOTS_edr3['00'][0.126]['A(Li)'], linewidth=1, color = 'k', linestyle='--', label='SPOTS-YBC f000; 126 Myr')
ax.plot(SPOTS_edr3['85'][0.126]['G-J'], SPOTS_edr3['85'][0.126]['A(Li)'], linewidth=1, color = 'k', linestyle=':', label='SPOTS-YBC f085; 126 Myr')



ax.errorbar(data_obs_Pleiades['g']-data_obs_Pleiades['Jmag'], data_obs_Pleiades['ALi'], yerr=data_obs_Pleiades['e_ALi'], fmt='.', zorder=0, color='r', elinewidth=1, capsize=2)
ax.legend(fontsize=12, loc='upper center', bbox_to_anchor=(1.25, 0.9))
Out[75]:
<matplotlib.legend.Legend at 0x7fd7228a20d0>
No description has been provided for this image
In [76]:
fig, ax = plt.subplots(1, 1, figsize=(8, 6))

ax.set_ylabel('$A(Li)$ [dex]')
ax.set_xlabel('$T_{eff}$ [K]')
ax.plot(SPOTS_edr3['00'][0.056]['Teff'], SPOTS_edr3['00'][0.056]['A(Li)'], linewidth=1, color='orange',  label='SPOTS-YBC f000; 56 Myr')
ax.plot(SPOTS_edr3['17'][0.056]['Teff'], SPOTS_edr3['17'][0.056]['A(Li)'], linewidth=1, linestyle='--', color='orange', label='SPOTS-YBC f017; 56 Myr')
ax.plot(SPOTS_edr3['85'][0.056]['Teff'], SPOTS_edr3['51'][0.056]['A(Li)'], linewidth=1, linestyle=':', color='orange', label='SPOTS-YBC f085; 50 Myr')
ax.plot(SPOTS_edr3['00'][0.05]['Teff'], SPOTS_edr3['00'][0.05]['A(Li)'], linewidth=1, color='r', label='SPOTS-YBC f000; 50 Myr')
ax.plot(SPOTS_edr3['17'][0.05]['Teff'], SPOTS_edr3['17'][0.05]['A(Li)'], linewidth=1, linestyle='--', color='r', label='SPOTS-YBC f017; 50 Myr')
ax.plot(SPOTS_edr3['85'][0.05]['Teff'], SPOTS_edr3['51'][0.05]['A(Li)'], linewidth=1, linestyle=':', color='r', label='SPOTS-YBC f085; 50 Myr')
ax.plot(SPOTS_edr3['00'][0.126]['Teff'], SPOTS_edr3['00'][0.126]['A(Li)'], linewidth=1, color = 'k', label='SPOTS-YBC f000; 126 Myr')
ax.plot(SPOTS_edr3['17'][0.126]['Teff'], SPOTS_edr3['17'][0.126]['A(Li)'], linewidth=1, color = 'k', linestyle='--', label='SPOTS-YBC f017; 126 Myr')
ax.plot(SPOTS_edr3['85'][0.126]['Teff'], SPOTS_edr3['85'][0.126]['A(Li)'], linewidth=1, color = 'k', linestyle=':', label='SPOTS-YBC f085; 126 Myr')



ax.invert_xaxis()

ax.errorbar(data_obs_Pleiades['Teff'], data_obs_Pleiades['ALi'], yerr=data_obs_Pleiades['e_ALi'], fmt='.', zorder=0, color='r', elinewidth=1, capsize=2)
ax.legend(fontsize=12, loc='upper center', bbox_to_anchor=(1.25, 0.9))
Out[76]:
<matplotlib.legend.Legend at 0x7fd72d45a1d0>
No description has been provided for this image
In [77]:
fig, ax = plt.subplots(1, 1, figsize=(8, 6))

ax.set_ylabel('$G$ [mag]')
ax.set_xlabel('$B_p-R_p$ [mag]')

ax.plot(SPOTS_edr3['00'][0.126]['BP_abs']-SPOTS_edr3['00'][0.126]['RP_abs'], SPOTS_edr3['00'][0.126]['G_abs'], linewidth=1, label='SPOTS-YBC f000; 126 Myr', color='k')

ax.plot(SPOTS_edr3['17'][0.126]['BP_abs']-SPOTS_edr3['17'][0.126]['RP_abs'], SPOTS_edr3['17'][0.126]['G_abs'], linewidth=1, label='SPOTS-YBC f017; 126 Myr', color='r')

ax.plot(SPOTS_edr3['34'][0.126]['BP_abs']-SPOTS_edr3['34'][0.126]['RP_abs'], SPOTS_edr3['34'][0.126]['G_abs'], linewidth=1, label='SPOTS-YBC f034; 126 Myr', color='orange')

ax.plot(SPOTS_edr3['51'][0.126]['BP_abs']-SPOTS_edr3['51'][0.126]['RP_abs'], SPOTS_edr3['51'][0.126]['G_abs'], linewidth=1, label='SPOTS-YBC f051; 126 Myr', color='green')

ax.plot(SPOTS_edr3['85'][0.126]['BP_abs']-SPOTS_edr3['85'][0.126]['RP_abs'], SPOTS_edr3['85'][0.126]['G_abs'], linewidth=1, label='SPOTS-YBC f085; 126 Myr', color='blue')


ax.errorbar(data_obs_Pleiades['BP_abs']-data_obs_Pleiades['RP_abs'], data_obs_Pleiades['G_abs'], yerr=data_obs_Pleiades['e_g'], fmt='.', zorder=0, color='r', elinewidth=1, capsize=2, alpha=0.125)
ax.legend(fontsize=12, loc='upper center', bbox_to_anchor=(1.25, 0.9))
ax.invert_yaxis()
No description has been provided for this image
In [78]:
fig, ax = plt.subplots(1, 1, figsize=(8, 6))

ax.set_ylabel('$G$ [mag]')
ax.set_xlabel('$G-J$ [mag]')

ax.plot(SPOTS_edr3['00'][0.126]['G_abs']-SPOTS_edr3['00'][0.126]['J_abs'], SPOTS_edr3['00'][0.126]['G_abs'], linewidth=1, label='SPOTS-YBC f000; 126 Myr', color='k')

ax.plot(SPOTS_edr3['17'][0.126]['G_abs']-SPOTS_edr3['17'][0.126]['J_abs'], SPOTS_edr3['17'][0.126]['G_abs'], linewidth=1, label='SPOTS-YBC f017; 126 Myr', color='r')

ax.plot(SPOTS_edr3['34'][0.126]['G_abs']-SPOTS_edr3['34'][0.126]['J_abs'], SPOTS_edr3['34'][0.126]['G_abs'], linewidth=1, label='SPOTS-YBC f034; 126 Myr', color='orange')

ax.plot(SPOTS_edr3['51'][0.126]['G_abs']-SPOTS_edr3['51'][0.126]['J_abs'], SPOTS_edr3['51'][0.126]['G_abs'], linewidth=1, label='SPOTS-YBC f051; 126 Myr', color='green')

ax.plot(SPOTS_edr3['85'][0.126]['G_abs']-SPOTS_edr3['85'][0.126]['J_abs'], SPOTS_edr3['85'][0.126]['G_abs'], linewidth=1, label='SPOTS-YBC f085; 126 Myr', color='blue')


ax.errorbar(data_obs_Pleiades['G_abs']-data_obs_Pleiades['J_abs'], data_obs_Pleiades['G_abs'], yerr=data_obs_Pleiades['e_g'], fmt='.', zorder=0, color='r', elinewidth=1, capsize=2, alpha=0.125)
ax.legend(fontsize=12, loc='upper center', bbox_to_anchor=(1.25, 0.9))
ax.invert_yaxis()
No description has been provided for this image
In [79]:
fig, ax = plt.subplots(1, 1, figsize=(8, 6))

ax.set_ylabel('$G$ [mag]')
ax.set_xlabel('$G-R_p$ [mag]')

ax.plot(SPOTS_edr3['00'][0.126]['G_abs']-SPOTS_edr3['00'][0.126]['RP_abs'], SPOTS_edr3['00'][0.126]['G_abs'], linewidth=1, label='SPOTS-YBC f000; 126 Myr', color='k')

ax.plot(SPOTS_edr3['17'][0.126]['G_abs']-SPOTS_edr3['17'][0.126]['RP_abs'], SPOTS_edr3['17'][0.126]['G_abs'], linewidth=1, label='SPOTS-YBC f017; 126 Myr', color='r')

ax.plot(SPOTS_edr3['34'][0.126]['G_abs']-SPOTS_edr3['34'][0.126]['RP_abs'], SPOTS_edr3['34'][0.126]['G_abs'], linewidth=1, label='SPOTS-YBC f034; 126 Myr', color='orange')

ax.plot(SPOTS_edr3['51'][0.126]['G_abs']-SPOTS_edr3['51'][0.126]['RP_abs'], SPOTS_edr3['51'][0.126]['G_abs'], linewidth=1, label='SPOTS-YBC f051; 126 Myr', color='green')

ax.plot(SPOTS_edr3['85'][0.126]['G_abs']-SPOTS_edr3['85'][0.126]['RP_abs'], SPOTS_edr3['85'][0.126]['G_abs'], linewidth=1, label='SPOTS-YBC f085; 126 Myr', color='blue')


ax.errorbar(data_obs_Pleiades['G_abs']-data_obs_Pleiades['RP_abs'], data_obs_Pleiades['G_abs'], yerr=data_obs_Pleiades['e_g'], fmt='.', zorder=0, color='r', elinewidth=1, capsize=2, alpha=0.125)
ax.legend(fontsize=12, loc='upper center', bbox_to_anchor=(1.25, 0.9))
ax.invert_yaxis()

ax.set_xlim(0, 1.5)
Out[79]:
(0.0, 1.5)
No description has been provided for this image
In [80]:
SPOTS_edr3['00'][0.126]['Teff']
Out[80]:
0     2949.742462
1     3141.861887
2     3243.838470
3     3317.959343
4     3378.171160
5     3436.631053
6     3518.427448
7     3615.667953
8     3741.906660
9     3891.281506
10    4014.089117
11    4183.549674
12    4395.352697
13    4615.127249
14    4839.938464
15    5056.377615
16    5261.455359
17    5454.735418
18    5635.369148
19    5801.018360
20    5953.197490
21    6098.292624
22    6238.221627
23    6374.414055
24    6512.426278
Name: Teff, dtype: float64
In [81]:
fig, ax = plt.subplots(1, 1, figsize=(8, 6))

ax.set_ylabel('$\log{(\mathcal{L}/\mathcal{L}_{\odot})}$')
ax.set_xlabel('$T_{eff}$ [K]')

ax.plot(SPOTS_edr3['00'][0.126]['Teff'], SPOTS_edr3['00'][0.126]['log(L/Lsun)'], linewidth=1, label='SPOTS-YBC f000; 126 Myr', color='k')

ax.plot(SPOTS_edr3['17'][0.126]['Teff'], SPOTS_edr3['17'][0.126]['log(L/Lsun)'], linewidth=1, label='SPOTS-YBC f017; 126 Myr', color='r')

ax.plot(SPOTS_edr3['34'][0.126]['Teff'], SPOTS_edr3['34'][0.126]['log(L/Lsun)'], linewidth=1, label='SPOTS-YBC f034; 126 Myr', color='orange')

ax.plot(SPOTS_edr3['51'][0.126]['Teff'], SPOTS_edr3['51'][0.126]['log(L/Lsun)'], linewidth=1, label='SPOTS-YBC f051; 126 Myr', color='green')

ax.plot(SPOTS_edr3['85'][0.126]['Teff'], SPOTS_edr3['85'][0.126]['log(L/Lsun)'], linewidth=1, label='SPOTS-YBC f085; 126 Myr', color='blue')


ax.scatter(data_obs_Pleiades['Teff_x'], data_obs_Pleiades['log(L/Lsun)'], zorder=0, color='r', s=10, alpha=0.125)
ax.legend(fontsize=12, loc='upper center', bbox_to_anchor=(1.25, 0.9))
ax.invert_xaxis()
No description has been provided for this image

SPOTS analysis¶

OPTION 1¶

In [67]:
from models_test import PlotAnalyzer
In [83]:
BTSettl_Li_isochrones_Teff.columns
Out[83]:
Index(['age_Gyr', 't(Gyr)', 'M/Ms', 'Teff', 'log(L/Lsun)', 'lg(g)', 'R(Gcm)',
       'D', 'Li', 'G_abs', 'BP_abs', 'RP_abs', 'J_abs', 'H_abs', 'K_abs',
       'g_abs', 'r_abs', 'i_abs', 'y_abs', 'z_abs', 'A(Li)', 'Lsun'],
      dtype='object')
In [70]:
plot_analyzer = PlotAnalyzer(path_all)

SPOTS = plot_analyzer.SPOTS_edr3
data_obs = data_obs_Pleiades
band_1 = 'BP_abs'
band_2 = 'RP_abs'
band_y = 'G_abs'
age_iso = 0.120
max_mag = 3.5

intervals, interval_x, x, y, e_x, e_y = plot_analyzer.plot_process_CMD(SPOTS, data_obs, band_1, band_2, band_y, age_iso, max_mag)

SPOTS_iso = plot_analyzer.plot_result(interval_x, x, y, e_x, e_y, SPOTS, band_1, band_2, band_y, data_obs, age_iso, max_mag, l=2, BTSettl=True)
Exe. time: 7 minutos y 31.24 segundos.
Exe. time: 0 minutos y 0.07 segundos.
No description has been provided for this image
No description has been provided for this image
In [71]:
plot_analyzer = PlotAnalyzer(path_all)

SPOTS = plot_analyzer.SPOTS_edr3
data_obs = data_obs_Pleiades
band_1 = 'G_abs'
band_2 = 'J_abs'
band_y = 'G_abs'
age_iso = 0.120
max_mag = 3.5

intervals_J, interval_x_J, x_J, y_J, e_x_J, e_y_J = plot_analyzer.plot_process_CMD(SPOTS, data_obs, band_1, band_2, band_y, age_iso, max_mag)

SPOTS_iso_J = plot_analyzer.plot_result(interval_x_J, x_J, y_J, e_x_J, e_y_J, SPOTS, band_1, band_2, band_y, data_obs, age_iso, max_mag, l=2, BTSettl=True)
Exe. time: 7 minutos y 12.63 segundos.
Exe. time: 0 minutos y 0.07 segundos.
No description has been provided for this image
No description has been provided for this image
In [72]:
plot_analyzer = PlotAnalyzer(path_all)

SPOTS = plot_analyzer.SPOTS_edr3
data_obs = data_obs_Pleiades
band_1 = 'G_abs'
band_2 = 'RP_abs'
band_y = 'G_abs'
age_iso = 0.120
max_mag = 1.4

intervals_R, interval_x_R, x_R, y_R, e_x_R, e_y_R = plot_analyzer.plot_process_CMD(SPOTS, data_obs, band_1, band_2, band_y, age_iso, max_mag)

SPOTS_iso_R = plot_analyzer.plot_result(interval_x_R, x_R, y_R, e_x_R, e_y_R, SPOTS, band_1, band_2, band_y, data_obs, age_iso, max_mag, l=2, BTSettl=True)
Exe. time: 7 minutos y 43.65 segundos.
Exe. time: 0 minutos y 0.09 segundos.
No description has been provided for this image
No description has been provided for this image
In [73]:
fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(16, 6))

ax1.set_ylabel('$G$ [mag]')
ax1.set_xlabel('$G-J$ [mag]')

ax1.plot(SPOTS_edr3['00'][0.126]['G-J'], SPOTS_edr3['00'][0.126]['G_abs'], label='SPOTS-YBC f000; 126 Myr', color='k', linewidth=1, linestyle='--')

ax1.plot(SPOTS_edr3['17'][0.126]['G-J'], SPOTS_edr3['17'][0.126]['G_abs'], label='SPOTS-YBC f017; 126 Myr', color='r', linewidth=1, linestyle='--')

ax1.plot(SPOTS_edr3['34'][0.126]['G-J'], SPOTS_edr3['34'][0.126]['G_abs'], label='SPOTS-YBC f034; 126 Myr', color='orange', linewidth=1, linestyle='--')

ax1.plot(SPOTS_edr3['51'][0.126]['G-J'], SPOTS_edr3['51'][0.126]['G_abs'], label='SPOTS-YBC f051; 126 Myr', color='green', linewidth=1, linestyle='--')

ax1.plot(SPOTS_edr3['51'][0.126]['G-J'], SPOTS_edr3['51'][0.126]['G_abs'], label='SPOTS-YBC f051; 126 Myr', color='blue', linewidth=1, linestyle='--')

ax1.plot(SPOTS_edr3['85'][0.126]['G-J'], SPOTS_edr3['85'][0.126]['G_abs'], label='SPOTS-YBC f085; 126 Myr', color='magenta', linewidth=1, linestyle='--')


ax1.errorbar(data_obs_Pleiades['G_abs']-data_obs_Pleiades['J_abs'], data_obs_Pleiades['G_abs'], yerr=data_obs_Pleiades['e_g'], fmt='.', zorder=0, color='r', elinewidth=1, capsize=2, alpha=0.125)

ax1.plot(SPOTS_iso_J[0.126]['G_abs']-SPOTS_iso_J[0.126]['J_abs'], SPOTS_iso_J[0.126]['G_abs'], linewidth=1, linestyle='-', color='r', label='Mixture Isochrone G-J', zorder=5)
ax1.plot(SPOTS_iso_R[0.126]['G_abs']-SPOTS_iso_R[0.126]['J_abs'], SPOTS_iso_R[0.126]['G_abs'], linewidth=1, linestyle='-', color='b', label='Mixture Isochrone BP-RP', zorder=5)



ax1.invert_yaxis()

ax2.set_ylabel('$G$ [mag]')
ax2.set_xlabel('$B_p-R_p$ [mag]')

ax2.plot(SPOTS_edr3['00'][0.126]['BP-RP'], SPOTS_edr3['00'][0.126]['G_abs'], color='k', linewidth=1, linestyle='--')

ax2.plot(SPOTS_edr3['17'][0.126]['BP-RP'], SPOTS_edr3['17'][0.126]['G_abs'], color='r', linewidth=1, linestyle='--')

ax2.plot(SPOTS_edr3['34'][0.126]['BP-RP'], SPOTS_edr3['34'][0.126]['G_abs'], color='orange', linewidth=1, linestyle='--')

ax2.plot(SPOTS_edr3['51'][0.126]['BP-RP'], SPOTS_edr3['51'][0.126]['G_abs'], color='green', linewidth=1, linestyle='--')

ax2.plot(SPOTS_edr3['51'][0.126]['BP-RP'], SPOTS_edr3['51'][0.126]['G_abs'], color='blue', linewidth=1, linestyle='--')

ax2.plot(SPOTS_edr3['85'][0.126]['BP-RP'], SPOTS_edr3['85'][0.126]['G_abs'], color='magenta', linewidth=1, linestyle='--')


ax2.errorbar(data_obs_Pleiades['BP_abs']-data_obs_Pleiades['RP_abs'], data_obs_Pleiades['G_abs'], yerr=data_obs_Pleiades['e_g'], fmt='.', zorder=0, color='r', elinewidth=1, capsize=2, alpha=0.125)

ax2.plot(SPOTS_iso[0.126]['BP_abs']-SPOTS_iso[0.126]['RP_abs'], SPOTS_iso[0.126]['G_abs'], linewidth=1, linestyle='-', color='b', label='Mixture Isochrone BP-RP', zorder=5)
ax2.plot(SPOTS_iso_R[0.126]['BP_abs']-SPOTS_iso_R[0.126]['RP_abs'], SPOTS_iso_R[0.126]['G_abs'], linewidth=1, linestyle='-', color='r', label='Mixture Isochrone G-RP', zorder=5)


ax2.invert_yaxis()

ax2.legend(fontsize=12, loc='upper center', bbox_to_anchor=(1.35, 0.9))
Out[73]:
<matplotlib.legend.Legend at 0x7fe644f0e090>
No description has been provided for this image
In [74]:
for f in SPOTS_edr3.keys():
    Teff_min = min(SPOTS_edr3[f][0.126]['Teff'])
    print(Teff_min)
2949.742462182295
2883.9097147476045
2811.0437185962996
2730.020134059595
2639.0898719544107
2535.588947283602
In [75]:
min(data_obs_Pleiades['Teff'])
Out[75]:
2500.0
In [76]:
min(data_obs_Pleiades['Teff_x'])
Out[76]:
2937.2412

OPTION 2¶

In [64]:
from models_test import PlotAnalyzer
In [ ]:
plot_analyzer = PlotAnalyzer(path_all)

SPOTS = plot_analyzer.SPOTS_edr3
data_obs = data_obs_Pleiades

age_iso = 0.120

intervals_Teff, interval_x_Teff, x_Teff, y_Teff, e_x_Teff, e_y_Teff = plot_analyzer.plot_process_HRD(SPOTS, data_obs, age_iso)
In [78]:
SPOTS_iso_Teff = plot_analyzer.plot_result_HRD(interval_x_Teff, x_Teff, y_Teff, e_x_Teff, e_y_Teff, SPOTS, data_obs, age_iso, l=0, BTSettl=True)
Exe. time: 0 minutos y 0.07 segundos.
No description has been provided for this image
In [79]:
plot_analyzer = PlotAnalyzer(path_all)

age_iso = 0.120
f_FGK = '17'
f_UCDs = '34'
mid = 12

plot_analyzer.plot_HRD(SPOTS_edr3, data_obs_Pleiades, age_iso, f_FGK, f_UCDs, mid)
Out[79]:
{0.126:            Teff  log(L/Lsun)
 0   6424.823035     0.412299
 1   6281.771719     0.330340
 2   6145.484816     0.244163
 3   6008.130953     0.153698
 4   5865.995426     0.059009
 5   5719.419609    -0.039741
 6   5562.186031    -0.142581
 7   5390.253745    -0.249784
 8   5204.909348    -0.361472
 9   5006.433940    -0.478294
 10  4794.969290    -0.601700
 11  4530.035861    -0.736951
 12  4295.761882    -0.876848
 13  4066.430555    -1.031144
 14  3916.686310    -1.153239
 15  3768.772046    -1.270122
 16  3576.675831    -1.440761
 17  3438.053813    -1.598062
 18  3337.158468    -1.732767
 19  3253.664509    -1.855306
 20  3196.032449    -1.970007
 21  3138.565164    -2.093052
 22  3070.130315    -2.239438
 23  2977.461880    -2.429194}
No description has been provided for this image

Relate Teff to abundances and Teff to colores.

Teff, d, BC -> M_i (correct BT-Settl to fix SPOTS for low-mass stars)

SPOTS extension¶

In [84]:
from models_test import PlotAnalyzer
In [85]:
plt.rcParams.update({'font.size': 11, 'axes.linewidth': 1, 'axes.edgecolor': 'k'})
plt.rcParams['font.family'] = 'serif'
In [86]:
SPOTS = SPOTS_edr3

f = '00'
minim_age = 0.02
maxim_age = 0.120

upplim = 0.2

plot_analyzer = PlotAnalyzer(path_all)

plot_analyzer.plot_ages(SPOTS, f, minim_age, maxim_age, upplim, BTSettl_str=True)
No description has been provided for this image
No description has been provided for this image
In [87]:
SPOTS = SPOTS_edr3

f = '34'
minim_age = 0.02
maxim_age = 0.120

upplim = 0.2

plot_analyzer = PlotAnalyzer(path_all)

plot_analyzer.plot_ages(SPOTS, f, minim_age, maxim_age, upplim, BTSettl_str=True)
No description has been provided for this image
No description has been provided for this image
In [88]:
SPOTS = SPOTS_edr3

f = '85'
minim_age = 0.02
maxim_age = 0.120

upplim = 0.2

plot_analyzer = PlotAnalyzer(path_all)

plot_analyzer.plot_ages(SPOTS, f, minim_age, maxim_age, upplim, BTSettl_str=True)
No description has been provided for this image
No description has been provided for this image

for age in SPOTS_edr3['00'].keys(): if age >= 0.08 and age < 0.2: print('____________', age) print(SPOTS_edr3['00'][age][['Teff', 'A(Li)']])

In [89]:
fig, ax = plt.subplots(1, 1, figsize=(8, 6))

ax.set_ylabel(r'$A(Li)$ [dex]')
ax.set_xlabel(r'$T_{eff}$ [mag]')

ax.plot(BTSettl_Li_isochrones[0.6]['Teff'], BTSettl_Li_isochrones[0.6]['A(Li)'], linewidth=1, label='600 Myr', linestyle='--', color='r')
ax.plot(BTSettl_Li_isochrones[0.7]['Teff'], BTSettl_Li_isochrones[0.7]['A(Li)'], linewidth=1, label='700 Myr', linestyle='--', color='b')
ax.plot(BTSettl_Li_isochrones[0.8]['Teff'], BTSettl_Li_isochrones[0.8]['A(Li)'], linewidth=1, label='800 Myr', linestyle='--', color='k')


ax.errorbar(data_obs_Pleiades['Teff'], data_obs_Pleiades['ALi'], yerr=data_obs_Pleiades['e_ALi'], fmt='.', zorder=0, color='r', elinewidth=1, capsize=2)

ax.invert_xaxis()

ax.legend(fontsize=12)
Out[89]:
<matplotlib.legend.Legend at 0x7f5908f11ad0>
No description has been provided for this image

BTSettl ages for SPOTS¶

In [82]:
plt.rcParams.update({'font.size': 11, 'axes.linewidth': 1, 'axes.edgecolor': 'k'})
plt.rcParams['font.family'] = 'serif'
In [83]:
ages_BTSettl = list(BTSettl_Li_isochrones.keys())
            
ages_SPOTS = list(SPOTS_edr3['00'].keys())

SPOTS_edr3_00 = {}

BTSettl_Li_isochrones_MS = {}

for age in BTSettl_Li_isochrones.keys():
    if age <= 4.0 and age >= 0.004:
        closest_age = ages_SPOTS[np.abs(ages_SPOTS - age).argmin()]
        SPOTS_edr3_00[closest_age] = SPOTS_edr3['00'][closest_age]
        BTSettl_Li_isochrones_MS[age] = BTSettl_Li_isochrones[age]

SPOTS_edr3_full = {}

for f in SPOTS_edr3.keys():
    SPOTS_edr3_full[f] = {}
    ages_SPOTS = list(SPOTS_edr3[f].keys())
    for age in BTSettl_Li_isochrones.keys():
        if age <= 4.0 and age >= 0.004:
            closest_age = ages_SPOTS[np.abs(ages_SPOTS - age).argmin()]
            SPOTS_edr3_full[f][closest_age] = SPOTS_edr3[f][closest_age]
            BTSettl_Li_isochrones_MS[age] = BTSettl_Li_isochrones[age]
In [84]:
SPOTS_edr3_00.keys()
Out[84]:
dict_keys([0.004, 0.005, 0.006, 0.007, 0.008, 0.009, 0.01, 0.02, 0.028, 0.04, 0.05, 0.063, 0.071, 0.079, 0.089, 0.1, 0.126, 0.158, 0.2, 0.316, 0.398, 0.501, 0.631, 0.708, 0.794, 0.891, 1.0, 1.995, 3.162, 3.981])
In [85]:
BTSettl_Li_isochrones_MS.keys()
Out[85]:
dict_keys([0.004, 0.005, 0.006, 0.007, 0.008, 0.009, 0.01, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.1, 0.12, 0.15, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 2.0, 3.0, 4.0])
In [86]:
from models_test import SPOTS_extended
In [87]:
BTSettl = BTSettl_Li_isochrones_MS

SPOTS = SPOTS_edr3_full

MS_color_file = 'MS_color.csv'

f = ['00', '17', '34', '51', '68', '85']

# Must be dics!!!! ^^^^

SPOTS_expanded, BTSettl_Li_isochrones_Teff_dic = SPOTS_extended(MS_color_file, BTSettl, SPOTS, f).SPOTS_extension()
In [88]:
SPOTS_expanded['00'][0.126]
Out[88]:
logAge Mass Fspot Xspot log(L/Lsun) log(R/Rsun) log(g) log(Teff) log(T_hot) log(T_cool) ... H-K G-H G-K G-V A(Li) Lsun Teff M_bol BCv RP-J
0 8.100000 1.300 0.0 0.8 0.412322 0.101930 4.347365 3.813743 3.813743 0.0000 ... 0.03369 0.94187 0.97556 -0.15675 3.246089 2.584178 6512.426278 3.721184 NaN 0.36903
1 8.100000 1.250 0.0 0.8 0.330458 0.079603 4.374986 3.804440 3.804440 0.0000 ... 0.03575 1.00924 1.04499 -0.16294 3.226090 2.140217 6374.414055 3.925846 NaN 0.39482
2 8.100000 1.200 0.0 0.8 0.244443 0.055355 4.405754 3.795061 3.795061 0.0000 ... 0.03804 1.07753 1.11557 -0.16850 3.199054 1.755672 6238.221627 4.140882 NaN 0.42129
3 8.100000 1.150 0.0 0.8 0.154305 0.029990 4.437999 3.785208 3.785208 0.0000 ... 0.04084 1.14885 1.18969 -0.17206 3.162471 1.426608 6098.292624 4.366229 NaN 0.44928
4 8.100000 1.100 0.0 0.8 0.060162 0.003835 4.471005 3.774750 3.774750 0.0000 ... 0.04458 1.22739 1.27197 -0.17662 3.113608 1.148582 5953.197490 4.601585 NaN 0.48050
5 8.100000 1.050 0.0 0.8 -0.037916 -0.022712 4.503896 3.763504 3.763504 0.0000 ... 0.04858 1.31496 1.36354 -0.20177 3.047699 0.916397 5801.018360 4.846781 NaN 0.51578
6 8.100000 1.000 0.0 0.8 -0.140140 -0.048660 4.534602 3.750922 3.750922 0.0000 ... 0.05284 1.40895 1.46179 -0.22926 2.958403 0.724203 5635.369148 5.102339 NaN 0.55408
7 8.100000 0.950 0.0 0.8 -0.246858 -0.073722 4.562450 3.736774 3.736774 0.0000 ... 0.05927 1.52179 1.58106 -0.24622 2.831645 0.566424 5454.735418 5.369136 NaN 0.60046
8 8.100000 0.900 0.0 0.8 -0.358181 -0.098047 4.587620 3.721106 3.721106 0.0000 ... 0.06548 1.65187 1.71735 -0.26414 2.641553 0.438348 5261.455359 5.647442 NaN 0.65401
9 8.100000 0.850 0.0 0.8 -0.474711 -0.121780 4.610261 3.703839 3.703839 0.0000 ... 0.07325 1.80349 1.87674 -0.30101 2.349644 0.335189 5056.377615 5.938767 NaN 0.71601
10 8.100000 0.800 0.0 0.8 -0.597804 -0.145327 4.631026 3.684840 3.684840 0.0000 ... 0.08276 1.97991 2.06267 -0.34286 1.881039 0.252462 4839.938464 6.246499 NaN 0.78762
11 8.100000 0.750 0.0 0.8 -0.728511 -0.169368 4.651080 3.664184 3.664184 0.0000 ... 0.09376 2.19008 2.28384 -0.40592 1.075974 0.186848 4615.127249 6.573268 NaN 0.87372
12 8.100000 0.700 0.0 0.8 -0.864977 -0.195221 4.672823 3.642994 3.642994 0.0000 ... 0.11210 2.40327 2.51537 -0.46759 -0.421246 0.136466 4395.352697 6.914432 NaN 0.96956
13 8.100000 0.650 0.0 0.8 -1.012628 -0.226149 4.702494 3.621545 3.621545 0.0000 ... 0.14166 2.57682 2.71848 -0.55648 -inf 0.097134 4183.549674 7.283560 NaN 1.06201
14 8.100000 0.600 0.0 0.8 -1.152988 -0.260413 4.736260 3.603587 3.603587 0.0000 ... 0.16852 2.69514 2.86366 -0.61492 -inf 0.070309 4014.089117 7.634459 NaN 1.13691
15 8.100000 0.550 0.0 0.8 -1.268473 -0.291167 4.759979 3.590093 3.590093 0.0000 ... 0.18849 2.78150 2.96999 -0.68095 -inf 0.053892 3891.281506 7.923174 NaN 1.19831
16 8.100000 0.500 0.0 0.8 -1.414063 -0.329963 4.796178 3.573093 3.573093 0.0000 ... 0.20717 2.90841 3.11558 -0.81893 -inf 0.038542 3741.906660 8.287148 NaN 1.29024
17 8.100000 0.450 0.0 0.8 -1.560148 -0.373196 4.836887 3.558189 3.558189 0.0000 ... 0.21722 3.03013 3.24735 -0.92722 -inf 0.027533 3615.667953 8.652360 NaN 1.37750
18 8.100000 0.400 0.0 0.8 -1.690418 -0.414652 4.868646 3.546349 3.546349 0.0000 ... 0.22274 3.12717 3.34991 -1.00765 -inf 0.020398 3518.427448 8.978036 NaN 1.44727
19 8.100000 0.350 0.0 0.8 -1.810935 -0.454479 4.890308 3.536133 3.536133 0.0000 ... 0.22728 3.21378 3.44106 -1.10319 -inf 0.015455 3436.631053 9.279328 NaN 1.50979
20 8.100000 0.300 0.0 0.8 -1.925703 -0.496960 4.908324 3.528682 3.528682 0.0000 ... 0.23084 3.27957 3.51041 -1.18325 -inf 0.011866 3378.171160 9.566247 NaN 1.55754
21 8.100000 0.250 0.0 0.8 -2.050513 -0.543744 4.922710 3.520871 3.520871 0.0000 ... 0.23494 3.35311 3.58805 -1.28022 -inf 0.008902 3317.959343 9.878273 NaN 1.61108
22 8.100000 0.200 0.0 0.8 -2.201137 -0.599432 4.937177 3.511059 3.511059 0.0000 ... 0.24098 3.45150 3.69248 -1.43388 -inf 0.006293 3243.838470 10.254833 NaN 1.68260
23 8.100000 0.150 0.0 0.8 -2.395952 -0.669096 4.951565 3.497187 3.497187 0.0000 ... 0.25040 3.60048 3.85088 -1.73221 -inf 0.004018 3141.861887 10.741871 NaN 1.79121
24 8.100000 0.100 0.0 0.8 -2.689492 -0.761060 4.959401 3.469784 3.469784 0.0000 ... 0.26728 3.95060 4.21788 -2.47892 -inf 0.002044 2949.742462 11.475720 NaN 2.05097
25 8.100371 0.095 0.0 0.8 -2.790000 -0.806875 5.028756 3.467000 3.467000 2.7736 ... 0.32900 4.21800 4.55000 -1.95000 -0.700000 0.001622 2930.893245 6.772189 -3.58 2.25000
26 8.100371 0.090 0.0 0.8 -2.980000 -0.863279 5.118083 3.449000 3.449000 2.7592 ... 0.35200 4.37500 4.73000 -2.37000 2.345323 0.001047 2811.900830 6.913199 -4.13 2.34000
27 8.100371 0.085 0.0 0.8 -3.100000 -0.899629 5.165960 3.438000 3.438000 2.7504 ... 0.36000 4.53900 4.90000 -2.70000 2.687390 0.000794 2741.574172 7.004074 -4.62 2.45000
29 8.100371 0.080 0.0 0.8 -3.240000 -0.935542 5.211456 3.420000 3.420000 2.7360 ... 0.42200 4.78000 5.20000 -3.15000 3.254725 0.000575 2630.267992 7.093855 -5.32 2.58000
31 8.100371 0.077 0.0 0.8 -3.470000 -0.982967 5.289706 3.384000 3.384000 2.7072 ... 0.46500 5.34000 5.81000 -3.09000 3.298695 0.000339 2421.029047 7.212417 -5.78 3.06000
34 8.100371 0.074 0.0 0.8 -3.600000 -0.991400 5.289313 3.356000 3.356000 2.6848 ... 0.51000 5.55000 6.00000 -3.45000 3.300000 0.000251 2269.864852 7.233500 -6.25 3.11000
38 8.100371 0.068 0.0 0.8 -4.010000 -1.026872 5.323535 3.272000 3.272000 2.6176 ... 0.63000 10.21000 10.80000 0.00000 3.300000 0.000098 1870.682140 7.322180 -7.53 7.47000

32 rows × 63 columns

In [89]:
fig, ax = plt.subplots(1, 1, figsize=(8, 6))

ax.set_ylabel('$A(Li)$ [dex]')
ax.set_xlabel('G-RP [mag]')
ax.plot(SPOTS_edr3['00'][0.126]['G_abs'] - SPOTS_edr3['00'][0.126]['RP_abs'], SPOTS_edr3['00'][0.126]['A(Li)'], linewidth=1, label='SPOTS f000')
ax.plot(SPOTS_edr3['17'][0.126]['G_abs'] - SPOTS_edr3['17'][0.126]['RP_abs'], SPOTS_edr3['00'][0.126]['A(Li)'], linewidth=1, label='SPOTS f017')
ax.plot(SPOTS_edr3['34'][0.126]['G_abs'] - SPOTS_edr3['34'][0.126]['RP_abs'], SPOTS_edr3['00'][0.126]['A(Li)'], linewidth=1, label='SPOTS f034')
ax.plot(SPOTS_edr3['51'][0.126]['G_abs'] - SPOTS_edr3['51'][0.126]['RP_abs'], SPOTS_edr3['00'][0.126]['A(Li)'], linewidth=1, label='SPOTS f051')

#ax.scatter(SPOTS_edr3_expanded['00'][0.126]['G-RP'], SPOTS_edr3_expanded['00'][0.126]['A(Li)'], s=10, zorder=4, label='SPOTS expanded')
ax.plot(SPOTS_expanded['00'][0.126]['G-RP'], SPOTS_expanded['00'][0.126]['A(Li)'], lw=1, ls=':', color='b', zorder=4, label='SPOTS expanded')

ax.plot(BTSettl_Li_isochrones[0.120]['G_abs'] - BTSettl_Li_isochrones[0.120]['RP_abs'], BTSettl_Li_isochrones[0.120]['A(Li)'], linewidth=1, label='BT-Settl', linestyle='--', color='k')
ax.errorbar(data_obs_Pleiades['G_abs'] - data_obs_Pleiades['RP_abs'], data_obs_Pleiades['ALi'], yerr=data_obs_Pleiades['e_ALi'], fmt='.', zorder=0, color='r', elinewidth=1, capsize=2)

fig.legend(fontsize=12, loc='lower center', ncol=3, bbox_to_anchor=(0.525, -0.1))
Out[89]:
<matplotlib.legend.Legend at 0x7fd7231d9210>
No description has been provided for this image
In [90]:
fig, ax = plt.subplots(1, 1, figsize=(8, 6))

ax.set_ylabel('$A(Li)$ [dex]')
ax.set_xlabel('G-J [mag]')
ax.plot(SPOTS_edr3['00'][0.126]['G_abs'] - SPOTS_edr3['00'][0.126]['J_mag'], SPOTS_edr3['00'][0.126]['A(Li)'], linewidth=1, label='SPOTS f000')
ax.plot(SPOTS_edr3['17'][0.126]['G_abs'] - SPOTS_edr3['17'][0.126]['J_mag'], SPOTS_edr3['00'][0.126]['A(Li)'], linewidth=1, label='SPOTS f017')
ax.plot(SPOTS_edr3['34'][0.126]['G_abs'] - SPOTS_edr3['34'][0.126]['J_mag'], SPOTS_edr3['00'][0.126]['A(Li)'], linewidth=1, label='SPOTS f034')
ax.plot(SPOTS_edr3['51'][0.126]['G_abs'] - SPOTS_edr3['51'][0.126]['J_mag'], SPOTS_edr3['00'][0.126]['A(Li)'], linewidth=1, label='SPOTS f051')

#ax.scatter(SPOTS_edr3_expanded['00'][0.126]['G-RP'], SPOTS_edr3_expanded['00'][0.126]['A(Li)'], s=10, zorder=4, label='SPOTS expanded')
ax.plot(SPOTS_expanded['00'][0.126]['G-J'], SPOTS_expanded['00'][0.126]['A(Li)'], lw=1, ls=':', color='b', zorder=4, label='SPOTS expanded')

ax.plot(BTSettl_Li_isochrones[0.120]['G_abs'] - BTSettl_Li_isochrones[0.120]['J_abs'], BTSettl_Li_isochrones[0.120]['A(Li)'], linewidth=1, label='BT-Settl', linestyle='--', color='k')
ax.errorbar(data_obs_Pleiades['G_abs'] - data_obs_Pleiades['J_abs'], data_obs_Pleiades['ALi'], yerr=data_obs_Pleiades['e_ALi'], fmt='.', zorder=0, color='r', elinewidth=1, capsize=2)

ax.set_xlim(0, 6)

fig.legend(fontsize=12, loc='lower center', ncol=3, bbox_to_anchor=(0.525, -0.1))
Out[90]:
<matplotlib.legend.Legend at 0x7fd74409f510>
No description has been provided for this image
In [91]:
SPOTS_extended(MS_color_file, BTSettl, SPOTS, f).plot_CMD_ALi(SPOTS_expanded, BTSettl_Li_isochrones_Teff_dic, BTSettl_Li_isochrones, data_obs_Pleiades)
No description has been provided for this image
No description has been provided for this image
No description has been provided for this image
No description has been provided for this image
No description has been provided for this image
No description has been provided for this image
No description has been provided for this image
No description has been provided for this image
No description has been provided for this image
No description has been provided for this image
No description has been provided for this image
No description has been provided for this image
In [92]:
ages_SPOTS = np.array([float(age) for age in SPOTS_edr3['00'].keys()])

def plot_SPOTS_data(age_array, f_array, band1, band2, bandobs):
    """
    Plot SPOTS data with customizable age, f, and band combinations.

    Parameters:
        age_array (array-like): array of age values in Gyr.
        f_array (array-like): array of f values.
        band1 (str): first band for plotting.
        band2 (str): second band for plotting.
        bandobs (str): band for observational data.
    """
    plt.rcParams.update({'font.size': 12})  # Set the font size

    fig, ax = plt.subplots(1, 1, figsize=(8, 6))
    ax.set_ylabel(f'{band1} [mag]')
    ax.set_xlabel(f'{band1}-{band2} [mag]')

    # Color map creation
    cmap = plt.get_cmap('tab10')
    colors = [cmap(i) for i in np.linspace(0, 1, len(age_array))]

    # Line style array
    ls_array = ['-', '--', '-.', ':']

    for i, age in enumerate(age_array):
        age_Myr = age * 1000
        for j, f in enumerate(f_array):
            closest_age = ages_SPOTS[np.abs(ages_SPOTS - age).argmin()]
            if closest_age in SPOTS_edr3[f]:
                ax.plot(
                    SPOTS_edr3[f][closest_age][f'{band1}_abs'] - SPOTS_edr3[f][closest_age][f'{band2}_abs'],
                    SPOTS_edr3[f][closest_age][f'{band1}_abs'],
                    label=f'SPOTS-YBC f0{f}; {age_Myr} Myr',
                    color=colors[i],
                    lw=1,
                    ls=ls_array[j % len(ls_array)]
                )
            else:
                print(f"Closest age {closest_age} not found in SPOTS_edr3[f][{f}]")

    ax.scatter(data_obs_Pleiades[f'{band1}_abs'] - data_obs_Pleiades[f'{band2}_abs'], data_obs_Pleiades[f'{bandobs}_abs'], s=10, zorder=0, color='r', alpha=0.125)

    ax.scatter(BTSettl_Li_isochrones_Teff[f'{band1}_abs'] - BTSettl_Li_isochrones_Teff[f'{band2}_abs'], BTSettl_Li_isochrones_Teff[f'{bandobs}_abs'], s=10, label='Low-mass stars BT-Settl')

    ax.legend(fontsize=10, loc='upper center', bbox_to_anchor=(1.25, 0.9))

    ax.invert_yaxis()
    plt.show()

age_array = [0.001, 0.02, 0.120, 0.6, 4]
f_array = ['00', '51', '85']

plot_SPOTS_data(age_array, f_array, 'G', 'RP', 'G')
No description has been provided for this image

age_array = [0.001, 0.02, 0.120, 0.6, 4] f_array = ['00']

plot_SPOTS_data(age_array, f_array, 'G', 'RP', 'G')

plot_SPOTS_data(age_array, f_array, 'G', 'J', 'G')

In [93]:
MS_color = pd.read_csv('MS_color.csv')
    
for c in MS_color.columns:
    if c != '#SpT':
        MS_color[c] = pd.to_numeric(MS_color[c], errors='coerce')

MS_color = MS_color[10**MS_color['logT'] < 6000]

MS_color = MS_color[10**MS_color['logT'] > 1600]
In [94]:
def find_nearest_index(array, value):
    array = np.asarray(array)
    idx = (np.abs(array - value)).argmin()
    return idx

def calculate_log_g(mass, radius):
    """
    Calculate the surface gravity log(g) of a star.
    
    Parameters:
    - mass: Mass of the star in solar masses.
    - radius: Radius of the star in solar radii.
    
    Returns:
    - log_g: The surface gravity log(g) in cgs units.
    """
    G = 6.67430e-11  # gravitational constant in m^3 kg^-1 s^-2
    M_sun = 1.98847e30  # mass of the Sun in kg
    R_sun = 6.9634e8  # radius of the Sun in meters
    
    # Convert mass and radius to SI units
    mass_kg = mass * M_sun
    radius_m = radius * R_sun
    
    # Calculate g
    g = G * mass_kg / (radius_m ** 2)
    
    # Convert g to cgs units (cm/s^2)
    g_cgs = g * 100  # 1 m/s^2 = 100 cm/s^2
    
    # Calculate log(g)
    log_g = np.log10(g_cgs)
    
    return log_g

def SPOTS_extension(MS_color, BTSettl, SPOTS, f):
    """
    Extend SPOTS data using provided inputs.
    
    Parameters:
        MS_color (DataFrame): DataFrame for Phot. correction (Pecaut & Mamajek 2013)
        BTSettl (dict): Dictionary with BTSettl data.
        SPOTS (dict): Dictionary with SPOTS data.
        f (str): Factor value to use.
    
    Returns:
        SPOTS_expanded
    """
    M_bol_sun = 4.755
    Teff_sun = 5772

    Teff_max_array_SPOTS = []
    Teff_min_array_SPOTS = []
    age_array_SPOTS = []

    Teff_max_array_SPOTS_Li = []
    Teff_min_array_SPOTS_Li = []
    age_array_SPOTS_Li = []
    
    inf_index_SPOTS_array = []
    
    j = 0
    
    for age in SPOTS.keys():
        age_array_SPOTS.append(age)
        Teff_max = max(SPOTS[age]['Teff'])
        Teff_min = min(SPOTS[age]['Teff'])
        Teff_max_array_SPOTS.append(Teff_max)
        Teff_min_array_SPOTS.append(Teff_min)
        
        j += 1
        
        if age <= 0.7:
            Teff_series = np.array(SPOTS[age]['Teff'])
            A_Li_series = np.array(SPOTS[age]['A(Li)'])

            Teff_min_all = min(Teff_series)

            Teff_max_all = max(Teff_series)

            Teff_max = None

            for i in range(len(Teff_series)):
                if A_Li_series[i] == -np.inf:
                    Teff_min = Teff_series[i-1]
                    if i == 0:
                        Teff_min = Teff_min_all
                    else:
                        pass
                    inf_index_SPOTS_array.append(j - 1)
                    break

            for i in range(len(Teff_series)-1, -1, -1):
                if A_Li_series[i] == -np.inf:
                    Teff_max = Teff_series[i]
                    break

            if Teff_max is not None:
                age_array_SPOTS_Li.append(age)
                Teff_max_array_SPOTS_Li.append(Teff_max)
                Teff_min_array_SPOTS_Li.append(Teff_min)

    Teff_max_array_BTSettl = []
    Teff_min_array_BTSettl = []
    age_array_BTSettl = []

    Teff_max_array_BTSettl_Li = []
    Teff_min_array_BTSettl_Li = []
    age_array_BTSettl_Li = []

    for age in BTSettl.keys():
        age_array_BTSettl.append(age)
        Teff_max = max(BTSettl[age]['Teff'])
        Teff_min = min(BTSettl[age]['Teff'])
        Teff_max_array_BTSettl.append(Teff_max)
        Teff_min_array_BTSettl.append(Teff_min)
        
        if age <= 0.7:
            Teff_series = np.array(BTSettl[age]['Teff'])
            A_Li_series = np.array(BTSettl[age]['A(Li)'])

            Teff_min = None

            Teff_max = None

            for i in range(len(Teff_series)):
                if A_Li_series[i] == -np.inf:
                    inf_index_BTSettl = i-1
                    Teff_min = Teff_series[i-1]
                    break

            for i in range(len(Teff_series)-1, -1, -1):
                if A_Li_series[i] == -np.inf:
                    Teff_max = Teff_series[i+1]
                    break

            if Teff_max is not None:
                age_array_BTSettl_Li.append(age)
                Teff_max_array_BTSettl_Li.append(Teff_max)
                Teff_min_array_BTSettl_Li.append(Teff_min)
    
    MS_color['G-J'] = MS_color['G-V'] + MS_color['Mv'] - MS_color['M_J']
    MS_color['G-Ks'] = MS_color['G-V'] + MS_color['Mv'] - MS_color['M_Ks']
    MS_color['Teff'] = 10**MS_color['logT']
    MS_color = MS_color.reset_index()

    MS_color_filtered = MS_color[(MS_color['Teff'] >= 1750) & (MS_color['Teff'] <= 3000)].copy()
    MS_color_filtered.loc[:, 'logR'] = np.log10(MS_color_filtered['R_Rsun'])
    
    n = MS_color_filtered.shape[0]
    
    
    SPOTS_expanded = {}
    
    age_index = 0
    
    BTSettl_Li_isochrones_Teff_dic = {}

    count = 0
    
    for Teff_SPOTS_min in Teff_min_array_SPOTS:
        age_BTSettl = list(BTSettl.keys())[age_index]
        age_SPOTS = list(SPOTS.keys())[age_index]
        
        if inf_index_SPOTS_array[0] >= age_index:

            age_index += 1

            count += 1

            BTSettl_Li_isochrones_Teff = BTSettl[age_BTSettl][BTSettl[age_BTSettl]['Teff'] < Teff_SPOTS_min]
            BTSettl_Li_isochrones_Teff = BTSettl_Li_isochrones_Teff[BTSettl_Li_isochrones_Teff['Teff'] > min(BTSettl_Li_isochrones_Teff['Teff'])]
            BTSettl_Li_isochrones_Teff = BTSettl_Li_isochrones_Teff.sort_values(by='Teff', ascending=False)
            BTSettl_Li_isochrones_Teff['log(Teff)'] = np.log10(BTSettl_Li_isochrones_Teff['Teff'])
            BTSettl_Li_isochrones_Teff_dic[age_BTSettl] = BTSettl_Li_isochrones_Teff.reset_index()

            SPOTS[age_SPOTS]['log(Teff)'] = np.log10(SPOTS[age_SPOTS]['Teff'])
            SPOTS[age_SPOTS]['M_bol'] = - 10 * np.log10(SPOTS[age_SPOTS]['Teff']/Teff_sun) - 5 * SPOTS[age_SPOTS]['log(R/Rsun)'] + M_bol_sun
            SPOTS[age_SPOTS] = SPOTS[age_SPOTS].sort_values(by='log(Teff)', ascending=False)

            SPOTS_expanded[age_SPOTS] = SPOTS[age_SPOTS]

            SPOTS_expanded[age_SPOTS]['Lsun'] = 10**SPOTS_expanded[age_SPOTS]['log(L/Lsun)']

            SPOTS_expanded[age_SPOTS]['M_bol'] = M_bol_sun - 2.5 * SPOTS_expanded[age_SPOTS]['log(R/Rsun)']
            SPOTS_expanded[age_SPOTS]['G_abs'] = SPOTS_expanded[age_SPOTS]['G-V'] + SPOTS_expanded[age_SPOTS]['V_mag']
            SPOTS_expanded[age_SPOTS]['J_abs'] = - SPOTS_expanded[age_SPOTS]['G-J'] + SPOTS_expanded[age_SPOTS]['G_abs']
            SPOTS_expanded[age_SPOTS]['RP_abs'] = - SPOTS_expanded[age_SPOTS]['G-RP'] + SPOTS_expanded[age_SPOTS]['G_abs']
            SPOTS_expanded[age_SPOTS]['BP_abs'] = SPOTS_expanded[age_SPOTS]['BP-RP'] + SPOTS_expanded[age_SPOTS]['RP_abs']
            SPOTS_expanded[age_SPOTS]['H_abs'] = - SPOTS_expanded[age_SPOTS]['J-H'] + SPOTS_expanded[age_SPOTS]['J_abs']
            SPOTS_expanded[age_SPOTS]['K_abs'] = - SPOTS_expanded[age_SPOTS]['G-K'] + SPOTS_expanded[age_SPOTS]['G_abs']

            SPOTS_expanded[age_SPOTS]['RP-J'] = SPOTS_expanded[age_SPOTS]['RP_abs'] - SPOTS_expanded[age_SPOTS]['J_abs'] 
            SPOTS_expanded[age_SPOTS]['G-H'] = SPOTS_expanded[age_SPOTS]['G_abs'] - SPOTS_expanded[age_SPOTS]['H_abs'] 
            
            SPOTS_expanded[age_SPOTS] = SPOTS_expanded[age_SPOTS][~pd.isna(SPOTS_expanded[age_SPOTS]['A(Li)'])]
                        
    for Teff_BTSettl_min_Li, Teff_SPOTS_min in zip(Teff_min_array_BTSettl_Li, Teff_min_array_SPOTS):
        age_BTSettl = list(BTSettl.keys())[age_index]
        age_SPOTS = list(SPOTS.keys())[age_index]
        
        if Teff_BTSettl_min_Li <= Teff_SPOTS_min:
            
            age_index += 1
            
            count = count + 1

            BTSettl_Li_isochrones_Teff = BTSettl[age_BTSettl][BTSettl[age_BTSettl]['Teff'] < Teff_SPOTS_min]
            BTSettl_Li_isochrones_Teff = BTSettl_Li_isochrones_Teff[BTSettl_Li_isochrones_Teff['Teff'] > min(BTSettl_Li_isochrones_Teff['Teff'])]
            BTSettl_Li_isochrones_Teff = BTSettl_Li_isochrones_Teff.sort_values(by='Teff', ascending=False)
            BTSettl_Li_isochrones_Teff['log(Teff)'] = np.log10(BTSettl_Li_isochrones_Teff['Teff'])
            BTSettl_Li_isochrones_Teff = BTSettl_Li_isochrones_Teff.reset_index()
            BTSettl_Li_isochrones_Teff_dic[age_BTSettl] = BTSettl_Li_isochrones_Teff

            MS_color_rows = {}
            MS_color_rows[age_SPOTS] = pd.DataFrame(np.nan, index=range(n), columns=SPOTS[age_SPOTS].columns)
            
            SPOTS[age_SPOTS]['G-V'] = SPOTS[age_SPOTS]['G_abs'] - SPOTS[age_SPOTS]['V_mag']
            SPOTS[age_SPOTS]['log(Teff)'] = np.log10(SPOTS[age_SPOTS]['Teff'])
            SPOTS[age_SPOTS]['M_bol'] = - 10 * np.log10(SPOTS[age_SPOTS]['Teff']/Teff_sun) - 5 * SPOTS[age_SPOTS]['log(R/Rsun)'] + M_bol_sun
            SPOTS[age_SPOTS] = SPOTS[age_SPOTS].sort_values(by='log(Teff)', ascending=False)

            SPOTS_expanded[age_SPOTS] = pd.concat([SPOTS[age_SPOTS], MS_color_rows[age_SPOTS]], ignore_index=True)

            columns_map = {
                'Mass': 'Msun',
                'Teff': 'Teff',
                'log(Teff)': 'logT',
                'log(L/Lsun)': 'logL',
                'log(R/Rsun)': 'logR',
                'G-RP': 'G-Rp',
                'G-V': 'G-V',
                'G-J': 'G-J',
                'BP-RP': 'Bp-Rp',
                'J-H': 'J-H',
                'H-K': 'H-Ks',
                'G-K': 'G-Ks',
                'V_mag': 'Mv'
            }

            SPOTS_expanded[age_SPOTS]['BCv'] = np.nan
            start_index = len(SPOTS[age_SPOTS])

            for bc_col, spots_col in columns_map.items():
                SPOTS_expanded[age_SPOTS].loc[start_index:, bc_col] = MS_color_filtered[spots_col].values

            SPOTS_expanded[age_SPOTS]['Lsun'] = 10**SPOTS_expanded[age_SPOTS]['log(L/Lsun)']
            SPOTS_expanded[age_SPOTS].loc[start_index:, 'BCv'] = MS_color_filtered['BCv'].values

            for i in range(SPOTS[age_SPOTS]['logAge'].index[0]+1, len(SPOTS_expanded[age_SPOTS]['logAge'])):
                
                SPOTS_expanded[age_SPOTS].loc[i, 'logAge'] = np.log10(age_SPOTS*1e9)
                SPOTS_expanded[age_SPOTS].loc[i, 'Fspot'] = 0.0
                SPOTS_expanded[age_SPOTS].loc[i, 'Age_Gyr'] = SPOTS_expanded[age_SPOTS]['Age_Gyr'][0]
                SPOTS_expanded[age_SPOTS].loc[i, 'Xspot'] = 0.8
                SPOTS_expanded[age_SPOTS].loc[i, 'log(T_hot)'] = SPOTS_expanded[age_SPOTS]['log(Teff)'][i]
                SPOTS_expanded[age_SPOTS].loc[i, 'log(T_cool)'] = 0.0
                SPOTS_expanded[age_SPOTS].loc[i, 'M_bol'] = M_bol_sun - 2.5 * SPOTS_expanded[age_SPOTS].loc[i, 'log(R/Rsun)']
                SPOTS_expanded[age_SPOTS].loc[i, 'G_abs'] = SPOTS_expanded[age_SPOTS].loc[i, 'G-V'] + SPOTS_expanded[age_SPOTS].loc[i, 'V_mag']
                SPOTS_expanded[age_SPOTS].loc[i, 'J_abs'] = - SPOTS_expanded[age_SPOTS].loc[i, 'G-J'] + SPOTS_expanded[age_SPOTS].loc[i, 'G_abs']
                SPOTS_expanded[age_SPOTS].loc[i, 'RP_abs'] = - SPOTS_expanded[age_SPOTS].loc[i, 'G-RP'] + SPOTS_expanded[age_SPOTS].loc[i, 'G_abs']
                SPOTS_expanded[age_SPOTS].loc[i, 'BP_abs'] = SPOTS_expanded[age_SPOTS].loc[i, 'BP-RP'] + SPOTS_expanded[age_SPOTS].loc[i, 'RP_abs']
                SPOTS_expanded[age_SPOTS].loc[i, 'H_abs'] = - SPOTS_expanded[age_SPOTS].loc[i, 'J-H'] + SPOTS_expanded[age_SPOTS].loc[i, 'J_abs']
                SPOTS_expanded[age_SPOTS].loc[i, 'K_abs'] = - SPOTS_expanded[age_SPOTS].loc[i, 'G-K'] + SPOTS_expanded[age_SPOTS].loc[i, 'G_abs']

            min_Teff_max = SPOTS[age_SPOTS]['Teff'].min()
            min_Teff_min = 1600
            
            
            for i, row in BTSettl_Li_isochrones_Teff.iterrows():
                teff_value = row['Teff']
                if i == 1 and BTSettl_Li_isochrones_Teff.at[0, 'A(Li)'] == -np.inf and row['A(Li)'] == -np.inf:
                    a_li_value = BTSettl_Li_isochrones_Teff.at[i + 1, 'A(Li)'] if i + 1 < len(BTSettl_Li_isochrones_Teff) else 0
                else:
                    a_li_value = row['A(Li)']
                nearest_index = find_nearest_index(SPOTS_expanded[age_SPOTS]['Teff'], teff_value)
                SPOTS_expanded[age_SPOTS].at[nearest_index, 'A(Li)'] = a_li_value


            
            SPOTS_expanded[age_SPOTS]['RP-J'] = SPOTS_expanded[age_SPOTS]['RP_abs'] - SPOTS_expanded[age_SPOTS]['J_abs'] 
            SPOTS_expanded[age_SPOTS]['G-H'] = SPOTS_expanded[age_SPOTS]['G_abs'] - SPOTS_expanded[age_SPOTS]['H_abs'] 
            SPOTS_expanded[age_SPOTS] = SPOTS_expanded[age_SPOTS][~pd.isna(SPOTS_expanded[age_SPOTS]['A(Li)'])]
                    
        else:
            count = count + 1
            
            age_index += 1
            
            BTSettl_Li_isochrones_Teff = BTSettl[age_BTSettl][BTSettl[age_BTSettl]['Teff'] < Teff_SPOTS_min]
            BTSettl_Li_isochrones_Teff = BTSettl_Li_isochrones_Teff[BTSettl_Li_isochrones_Teff['Teff'] > min(BTSettl_Li_isochrones_Teff['Teff'])]
            BTSettl_Li_isochrones_Teff = BTSettl_Li_isochrones_Teff.sort_values(by='Teff', ascending=False)
            BTSettl_Li_isochrones_Teff['log(Teff)'] = np.log10(BTSettl_Li_isochrones_Teff['Teff'])
            BTSettl_Li_isochrones_Teff_dic[age_BTSettl] = BTSettl_Li_isochrones_Teff.reset_index()
            
            MS_color_rows = {}
            MS_color_rows[age_SPOTS] = pd.DataFrame(np.nan, index=range(n), columns=SPOTS[age_SPOTS].columns)
            
            SPOTS[age_SPOTS]['G-V'] = SPOTS[age_SPOTS]['G_abs'] - SPOTS[age_SPOTS]['V_mag']
            SPOTS[age_SPOTS]['log(Teff)'] = np.log10(SPOTS[age_SPOTS]['Teff'])
            SPOTS[age_SPOTS]['M_bol'] = - 10 * np.log10(SPOTS[age_SPOTS]['Teff']/Teff_sun) - 5 * SPOTS[age_SPOTS]['log(R/Rsun)'] + M_bol_sun
            SPOTS[age_SPOTS] = SPOTS[age_SPOTS].sort_values(by='log(Teff)', ascending=False)

            SPOTS_expanded[age_SPOTS] = pd.concat([SPOTS[age_SPOTS], MS_color_rows[age_SPOTS]], ignore_index=True)

            columns_map = {
                'Mass': 'Msun',
                'Teff': 'Teff',
                'log(Teff)': 'logT',
                'log(L/Lsun)': 'logL',
                'log(R/Rsun)': 'logR',
                'G-RP': 'G-Rp',
                'G-V': 'G-V',
                'G-J': 'G-J',
                'BP-RP': 'Bp-Rp',
                'J-H': 'J-H',
                'H-K': 'H-Ks',
                'G-K': 'G-Ks',
                'V_mag': 'Mv'
            }

            SPOTS_expanded[age_SPOTS]['BCv'] = np.nan
            start_index = len(SPOTS[age_SPOTS])

            for bc_col, spots_col in columns_map.items():
                SPOTS_expanded[age_SPOTS].loc[start_index:, bc_col] = MS_color_filtered[spots_col].values

            SPOTS_expanded[age_SPOTS]['Lsun'] = 10**SPOTS_expanded[age_SPOTS]['log(L/Lsun)']
            SPOTS_expanded[age_SPOTS].loc[start_index:, 'BCv'] = MS_color_filtered['BCv'].values

            for i in range(SPOTS[age_SPOTS]['logAge'].index[0]+1, len(SPOTS_expanded[age_SPOTS]['logAge'])):
                
                SPOTS_expanded[age_SPOTS].loc[i, 'logAge'] = np.log10(age_SPOTS*1e9)
                SPOTS_expanded[age_SPOTS].loc[i, 'Fspot'] = 0.0
                SPOTS_expanded[age_SPOTS].loc[i, 'Age_Gyr'] = SPOTS_expanded[age_SPOTS]['Age_Gyr'][0]
                SPOTS_expanded[age_SPOTS].loc[i, 'Xspot'] = 0.8
                SPOTS_expanded[age_SPOTS].loc[i, 'log(T_hot)'] = SPOTS_expanded[age_SPOTS]['log(Teff)'][i]
                SPOTS_expanded[age_SPOTS].loc[i, 'log(T_cool)'] = 0.0
                SPOTS_expanded[age_SPOTS].loc[i, 'M_bol'] = M_bol_sun - 2.5 * SPOTS_expanded[age_SPOTS].loc[i, 'log(R/Rsun)']
                SPOTS_expanded[age_SPOTS].loc[i, 'G_abs'] = SPOTS_expanded[age_SPOTS].loc[i, 'G-V'] + SPOTS_expanded[age_SPOTS].loc[i, 'V_mag']
                SPOTS_expanded[age_SPOTS].loc[i, 'J_abs'] = - SPOTS_expanded[age_SPOTS].loc[i, 'G-J'] + SPOTS_expanded[age_SPOTS].loc[i, 'G_abs']
                SPOTS_expanded[age_SPOTS].loc[i, 'RP_abs'] = - SPOTS_expanded[age_SPOTS].loc[i, 'G-RP'] + SPOTS_expanded[age_SPOTS].loc[i, 'G_abs']
                SPOTS_expanded[age_SPOTS].loc[i, 'BP_abs'] = SPOTS_expanded[age_SPOTS].loc[i, 'BP-RP'] + SPOTS_expanded[age_SPOTS].loc[i, 'RP_abs']
                SPOTS_expanded[age_SPOTS].loc[i, 'H_abs'] = - SPOTS_expanded[age_SPOTS].loc[i, 'J-H'] + SPOTS_expanded[age_SPOTS].loc[i, 'J_abs']
                SPOTS_expanded[age_SPOTS].loc[i, 'K_abs'] = - SPOTS_expanded[age_SPOTS].loc[i, 'G-K'] + SPOTS_expanded[age_SPOTS].loc[i, 'G_abs']

            min_Teff_max = SPOTS[age_SPOTS]['Teff'].min()
            min_Teff_min = 1600
            
            for i, row in BTSettl_Li_isochrones_Teff.iterrows():
                teff_value = row['Teff']
                if i == 1 and BTSettl_Li_isochrones_Teff.at[0, 'A(Li)'] == -np.inf and row['A(Li)'] == -np.inf:
                    a_li_value = BTSettl_Li_isochrones_Teff.at[i + 1, 'A(Li)'] if i + 1 < len(BTSettl_Li_isochrones_Teff) else 0
                else:
                    a_li_value = row['A(Li)']
                nearest_index = find_nearest_index(SPOTS_expanded[age_SPOTS]['Teff'], teff_value)
                SPOTS_expanded[age_SPOTS].at[nearest_index, 'A(Li)'] = a_li_value
            
            SPOTS_expanded[age_SPOTS]['RP-J'] = SPOTS_expanded[age_SPOTS]['RP_abs'] - SPOTS_expanded[age_SPOTS]['J_abs'] 
            SPOTS_expanded[age_SPOTS]['G-H'] = SPOTS_expanded[age_SPOTS]['G_abs'] - SPOTS_expanded[age_SPOTS]['H_abs'] 
            
            SPOTS_expanded[age_SPOTS] = SPOTS_expanded[age_SPOTS][~pd.isna(SPOTS_expanded[age_SPOTS]['A(Li)'])]
     
        SPOTS_expanded[age_SPOTS]['log(g)'] = calculate_log_g(SPOTS_expanded[age_SPOTS]['Mass'], 10**SPOTS_expanded[age_SPOTS]['log(R/Rsun)'])
    
    return SPOTS_expanded, BTSettl_Li_isochrones_Teff_dic


BTSettl = BTSettl_Li_isochrones_MS

SPOTS = SPOTS_edr3_00

f = '00'

SPOTS_expanded_00, BTSettl_Li_isochrones_Teff_dic = SPOTS_extension(MS_color, BTSettl, SPOTS, f)

plt.rcParams.update({'font.size': 14, 'axes.linewidth': 1, 'axes.edgecolor': 'k'})
plt.rcParams['font.family'] = 'serif'

fig, axs = plt.subplots(2, 3, figsize=(20, 10), constrained_layout=True)

bands1 = ['RP_abs', 'G_abs', 'G_abs', 'G_abs', 'G_abs', 'J_abs', 'H_abs', 'J_abs', 'H_abs']
bands2 = ['J_abs', 'J_abs', 'H_abs', 'K_abs', 'RP_abs', 'H_abs', 'K_abs', 'H_abs', 'K_abs']
colors = ['RP-J', 'G-J', 'G-H', 'G-K', 'G-RP', 'J-H', 'H-K', 'J-H', 'H-K']

norm_BTSettl = plt.Normalize(vmin=np.log10(0.004*1e9), vmax=np.log10(0.6*1e9))
cmap_BTSettl = cm.ScalarMappable(norm=norm_BTSettl, cmap='Reds')

norm_SPOTS = plt.Normalize(vmin=np.log10(0.004*1e9), vmax=np.log10(0.6*1e9))
cmap_SPOTS = cm.ScalarMappable(norm=norm_SPOTS, cmap='Blues')

ages_BTSettl = np.array(list(BTSettl_Li_isochrones_Teff_dic.keys()))
ages_SPOTS = np.array(list(SPOTS_expanded_00.keys()))

for i, ax in enumerate(axs.flat):
    band1 = bands1[i]
    band2 = bands2[i]
    color = colors[i]
    ax.scatter(data_obs_Pleiades[band1]-data_obs_Pleiades[band2], data_obs_Pleiades['ALi'], s=10, zorder=6, color='orange', alpha=0.5)
    ax.set_ylabel('$A(Li)$')
    ax.set_xlabel(f'{color} [mag]')
    
    max_array = []
    
    for age_BTSettl in BTSettl_Li_isochrones_Teff_dic.keys():
        if age_BTSettl < 0.6:
            log_age_BTSettl = np.log10(age_BTSettl * 1e9)
            color_BTSettl = cmap_BTSettl.to_rgba(log_age_BTSettl)
            ax.plot(BTSettl_Li_isochrones_Teff_dic[age_BTSettl][band1] - BTSettl_Li_isochrones_Teff_dic[age_BTSettl][band2], BTSettl_Li_isochrones_Teff_dic[age_BTSettl]['A(Li)'], c=color_BTSettl, lw=1, alpha=1, label='Low mass BT-Settl' if i == 0 and age_BTSettl == 0.5 else "")
            max_array.append(max(BTSettl_Li_isochrones_Teff_dic[age_BTSettl][band1] - BTSettl_Li_isochrones_Teff_dic[age_BTSettl][band2]))
    
    for age_SPOTS in SPOTS_expanded_00.keys():
        if age_SPOTS < 0.6:
            log_age_SPOTS = np.log10(age_SPOTS * 1e9)
            color_SPOTS = cmap_SPOTS.to_rgba(log_age_SPOTS)
            ax.plot(SPOTS_expanded_00[age_SPOTS][color], SPOTS_expanded_00[age_SPOTS]['A(Li)'], lw=1, color=color_SPOTS, zorder=1, alpha=1, label='SPOTS extended' if i == 0 and age_SPOTS == 0.501 else "")

    ax.plot(BTSettl_Li_isochrones[0.120][band1] - BTSettl_Li_isochrones[0.120][band2], BTSettl_Li_isochrones[0.120]['A(Li)'], lw=1, c='k', ls='--',  alpha=1, label='Low mass BT-Settl 120 Myr' if i == 0 else "")
    ax.plot(SPOTS_expanded_00[0.126][color], SPOTS_expanded_00[0.126]['A(Li)'], lw=1, color='k', ls='-', zorder=2, alpha=1, label='SPOTS extended 120 Myr' if i == 0 else "")
    
    ax.set_xlim(0, max(max_array))
    
fig.colorbar(cmap_BTSettl, ax=axs[:, 2], orientation='vertical', label=r'$\log({\rm Age\ [yr]})$')
cbar = fig.colorbar(cmap_SPOTS, ax=axs[:, 2], orientation='vertical', label=r'$\log({\rm Age\ [yr]})$')

cbar.ax.set_yticklabels([])
cbar.ax.set_ylabel("")


fig.legend(loc='upper center', bbox_to_anchor=(0.5, 1.15))

plt.show()

plt.rcParams.update({'font.size': 11, 'axes.linewidth': 1, 'axes.edgecolor': 'k'})
plt.rcParams['font.family'] = 'serif'

plt.rcParams.update({'font.size': 14, 'axes.linewidth': 1, 'axes.edgecolor': 'k'})
plt.rcParams['font.family'] = 'serif'

fig, axs = plt.subplots(2, 3, figsize=(20, 10), constrained_layout=True)

bands1 = ['RP_abs', 'G_abs', 'G_abs', 'G_abs', 'G_abs', 'J_abs', 'H_abs', 'J_abs', 'H_abs']
bands2 = ['J_abs', 'J_abs', 'H_abs', 'K_abs', 'RP_abs', 'H_abs', 'K_abs', 'H_abs', 'K_abs']
bandsobs = ['RP_abs', 'G_abs', 'G_abs', 'G_abs', 'G_abs', 'J_abs', 'H_abs']
colors = ['RP-J', 'G-J', 'G-H', 'G-K', 'G-RP', 'J-H', 'H-K', 'J-H', 'H-K']

norm_BTSettl = plt.Normalize(vmin=np.log10(0.004*1e9), vmax=np.log10(4*1e9))
cmap_BTSettl = cm.ScalarMappable(norm=norm_BTSettl, cmap='Reds')

norm_SPOTS = plt.Normalize(vmin=np.log10(0.004*1e9), vmax=np.log10(4*1e9))
cmap_SPOTS = cm.ScalarMappable(norm=norm_SPOTS, cmap='Blues')

ages_BTSettl = np.array(list(BTSettl_Li_isochrones_Teff_dic.keys()))
ages_SPOTS = np.array(list(SPOTS_expanded_00.keys()))

for i, ax in enumerate(axs.flat):
    band1 = bands1[i]
    band2 = bands2[i]
    bandobs = bandsobs[i]
    color = colors[i]
    ax.scatter(data_obs_Pleiades[band1]-data_obs_Pleiades[band2], data_obs_Pleiades[bandobs], s=10, zorder=6, color='orange', alpha=0.125)
    m = bandobs.split("_")[0]
    ax.set_ylabel(f'{m} [mag]')
    ax.set_xlabel(f'{color} [mag]')
    
    for age_BTSettl in BTSettl_Li_isochrones_Teff_dic.keys():
        log_age_BTSettl = np.log10(age_BTSettl * 1e9)
        color_BTSettl = cmap_BTSettl.to_rgba(log_age_BTSettl)
        ax.plot(BTSettl_Li_isochrones_Teff_dic[age_BTSettl][band1] - BTSettl_Li_isochrones_Teff_dic[age_BTSettl][band2], BTSettl_Li_isochrones_Teff_dic[age_BTSettl][bandobs], c=color_BTSettl, lw=1, alpha=1, label='Low mass BT-Settl' if i == 0 and age_BTSettl == ages_BTSettl[-1] else "")
    
    for age_SPOTS in SPOTS_expanded_00.keys():
        log_age_SPOTS = np.log10(age_SPOTS * 1e9)
        color_SPOTS = cmap_SPOTS.to_rgba(log_age_SPOTS)
        ax.plot(SPOTS_expanded_00[age_SPOTS][color], SPOTS_expanded_00[age_SPOTS][bandobs], lw=1, color=color_SPOTS, zorder=1, alpha=1, label='SPOTS extended' if i == 0 and age_SPOTS == ages_SPOTS[-1] else "")
    
    ax.invert_yaxis()

    ax.plot(BTSettl_Li_isochrones[0.120][band1] - BTSettl_Li_isochrones[0.120][band2], BTSettl_Li_isochrones[0.120][bandobs], lw=1, c='k', ls='--',  alpha=1, label='Low mass BT-Settl 120 Myr' if i == 0 else "")
    ax.plot(SPOTS_expanded_00[0.126][color], SPOTS_expanded_00[0.126][bandobs], lw=1, color='k', ls='-', zorder=2, alpha=1, label='SPOTS extended 120 Myr' if i == 0 else "")

    
fig.colorbar(cmap_BTSettl, ax=axs[:, 2], orientation='vertical', label=r'$\log({\rm Age\ [yr]})$')
cbar = fig.colorbar(cmap_SPOTS, ax=axs[:, 2], orientation='vertical', label=r'$\log({\rm Age\ [yr]})$')

cbar.ax.set_yticklabels([])
cbar.ax.set_ylabel("")


fig.legend(loc='upper center', bbox_to_anchor=(0.5, 1.15))

plt.show()

plt.rcParams.update({'font.size': 11, 'axes.linewidth': 1, 'axes.edgecolor': 'k'})
plt.rcParams['font.family'] = 'serif'
No description has been provided for this image
No description has been provided for this image
In [95]:
SPOTS_expanded_00.keys()
Out[95]:
dict_keys([0.004, 0.005, 0.006, 0.007, 0.008, 0.009, 0.01, 0.02, 0.028, 0.04, 0.05, 0.063, 0.071, 0.079, 0.089, 0.1, 0.126, 0.158, 0.2, 0.316, 0.398, 0.501, 0.631, 0.708, 0.794])
In [96]:
SPOTS_expanded_00[0.126]
Out[96]:
logAge Mass Fspot Xspot log(L/Lsun) log(R/Rsun) log(g) log(Teff) log(T_hot) log(T_cool) ... H-K G-H G-K G-V A(Li) Lsun Teff M_bol BCv RP-J
0 8.100000 1.300 0.0 0.8 0.412322 0.101930 4.347365 3.813743 3.813743 0.0 ... 0.03369 0.94187 0.97556 -0.15675 3.246089 2.584178 6512.426278 3.721184 NaN 0.36903
1 8.100000 1.250 0.0 0.8 0.330458 0.079603 4.374986 3.804440 3.804440 0.0 ... 0.03575 1.00924 1.04499 -0.16294 3.226090 2.140217 6374.414055 3.925846 NaN 0.39482
2 8.100000 1.200 0.0 0.8 0.244443 0.055355 4.405754 3.795061 3.795061 0.0 ... 0.03804 1.07753 1.11557 -0.16850 3.199054 1.755672 6238.221627 4.140882 NaN 0.42129
3 8.100000 1.150 0.0 0.8 0.154305 0.029990 4.437999 3.785208 3.785208 0.0 ... 0.04084 1.14885 1.18969 -0.17206 3.162471 1.426608 6098.292624 4.366229 NaN 0.44928
4 8.100000 1.100 0.0 0.8 0.060162 0.003835 4.471005 3.774750 3.774750 0.0 ... 0.04458 1.22739 1.27197 -0.17662 3.113608 1.148582 5953.197490 4.601585 NaN 0.48050
5 8.100000 1.050 0.0 0.8 -0.037916 -0.022712 4.503896 3.763504 3.763504 0.0 ... 0.04858 1.31496 1.36354 -0.20177 3.047699 0.916397 5801.018360 4.846781 NaN 0.51578
6 8.100000 1.000 0.0 0.8 -0.140140 -0.048660 4.534602 3.750922 3.750922 0.0 ... 0.05284 1.40895 1.46179 -0.22926 2.958403 0.724203 5635.369148 5.102339 NaN 0.55408
7 8.100000 0.950 0.0 0.8 -0.246858 -0.073722 4.562450 3.736774 3.736774 0.0 ... 0.05927 1.52179 1.58106 -0.24622 2.831645 0.566424 5454.735418 5.369136 NaN 0.60046
8 8.100000 0.900 0.0 0.8 -0.358181 -0.098047 4.587620 3.721106 3.721106 0.0 ... 0.06548 1.65187 1.71735 -0.26414 2.641553 0.438348 5261.455359 5.647442 NaN 0.65401
9 8.100000 0.850 0.0 0.8 -0.474711 -0.121780 4.610261 3.703839 3.703839 0.0 ... 0.07325 1.80349 1.87674 -0.30101 2.349644 0.335189 5056.377615 5.938767 NaN 0.71601
10 8.100000 0.800 0.0 0.8 -0.597804 -0.145327 4.631026 3.684840 3.684840 0.0 ... 0.08276 1.97991 2.06267 -0.34286 1.881039 0.252462 4839.938464 6.246499 NaN 0.78762
11 8.100000 0.750 0.0 0.8 -0.728511 -0.169368 4.651080 3.664184 3.664184 0.0 ... 0.09376 2.19008 2.28384 -0.40592 1.075974 0.186848 4615.127249 6.573268 NaN 0.87372
12 8.100000 0.700 0.0 0.8 -0.864977 -0.195221 4.672823 3.642994 3.642994 0.0 ... 0.11210 2.40327 2.51537 -0.46759 -0.421246 0.136466 4395.352697 6.914432 NaN 0.96956
13 8.100000 0.650 0.0 0.8 -1.012628 -0.226149 4.702494 3.621545 3.621545 0.0 ... 0.14166 2.57682 2.71848 -0.55648 -inf 0.097134 4183.549674 7.283560 NaN 1.06201
14 8.100000 0.600 0.0 0.8 -1.152988 -0.260413 4.736260 3.603587 3.603587 0.0 ... 0.16852 2.69514 2.86366 -0.61492 -inf 0.070309 4014.089117 7.634459 NaN 1.13691
15 8.100000 0.550 0.0 0.8 -1.268473 -0.291167 4.759979 3.590093 3.590093 0.0 ... 0.18849 2.78150 2.96999 -0.68095 -inf 0.053892 3891.281506 7.923174 NaN 1.19831
16 8.100000 0.500 0.0 0.8 -1.414063 -0.329963 4.796178 3.573093 3.573093 0.0 ... 0.20717 2.90841 3.11558 -0.81893 -inf 0.038542 3741.906660 8.287148 NaN 1.29024
17 8.100000 0.450 0.0 0.8 -1.560148 -0.373196 4.836887 3.558189 3.558189 0.0 ... 0.21722 3.03013 3.24735 -0.92722 -inf 0.027533 3615.667953 8.652360 NaN 1.37750
18 8.100000 0.400 0.0 0.8 -1.690418 -0.414652 4.868646 3.546349 3.546349 0.0 ... 0.22274 3.12717 3.34991 -1.00765 -inf 0.020398 3518.427448 8.978036 NaN 1.44727
19 8.100000 0.350 0.0 0.8 -1.810935 -0.454479 4.890308 3.536133 3.536133 0.0 ... 0.22728 3.21378 3.44106 -1.10319 -inf 0.015455 3436.631053 9.279328 NaN 1.50979
20 8.100000 0.300 0.0 0.8 -1.925703 -0.496960 4.908324 3.528682 3.528682 0.0 ... 0.23084 3.27957 3.51041 -1.18325 -inf 0.011866 3378.171160 9.566247 NaN 1.55754
21 8.100000 0.250 0.0 0.8 -2.050513 -0.543744 4.922710 3.520871 3.520871 0.0 ... 0.23494 3.35311 3.58805 -1.28022 -inf 0.008902 3317.959343 9.878273 NaN 1.61108
22 8.100000 0.200 0.0 0.8 -2.201137 -0.599432 4.937177 3.511059 3.511059 0.0 ... 0.24098 3.45150 3.69248 -1.43388 -inf 0.006293 3243.838470 10.254833 NaN 1.68260
23 8.100000 0.150 0.0 0.8 -2.395952 -0.669096 4.951565 3.497187 3.497187 0.0 ... 0.25040 3.60048 3.85088 -1.73221 -inf 0.004018 3141.861887 10.741871 NaN 1.79121
24 8.100000 0.100 0.0 0.8 -2.689492 -0.761060 4.959401 3.469784 3.469784 0.0 ... 0.26728 3.95060 4.21788 -2.47892 -inf 0.002044 2949.742462 11.475720 NaN 2.05097
25 8.100371 0.095 0.0 0.8 -2.790000 -0.806875 5.028756 3.467000 3.467000 0.0 ... 0.32900 4.21800 4.55000 -1.95000 -0.700000 0.001622 2930.893245 6.772189 -3.58 2.25000
26 8.100371 0.090 0.0 0.8 -2.980000 -0.863279 5.118083 3.449000 3.449000 0.0 ... 0.35200 4.37500 4.73000 -2.37000 2.345323 0.001047 2811.900830 6.913199 -4.13 2.34000
27 8.100371 0.085 0.0 0.8 -3.100000 -0.899629 5.165960 3.438000 3.438000 0.0 ... 0.36000 4.53900 4.90000 -2.70000 2.687390 0.000794 2741.574172 7.004074 -4.62 2.45000
29 8.100371 0.080 0.0 0.8 -3.240000 -0.935542 5.211456 3.420000 3.420000 0.0 ... 0.42200 4.78000 5.20000 -3.15000 3.254725 0.000575 2630.267992 7.093855 -5.32 2.58000
31 8.100371 0.077 0.0 0.8 -3.470000 -0.982967 5.289706 3.384000 3.384000 0.0 ... 0.46500 5.34000 5.81000 -3.09000 3.298695 0.000339 2421.029047 7.212417 -5.78 3.06000
34 8.100371 0.074 0.0 0.8 -3.600000 -0.991400 5.289313 3.356000 3.356000 0.0 ... 0.51000 5.55000 6.00000 -3.45000 3.300000 0.000251 2269.864852 7.233500 -6.25 3.11000
38 8.100371 0.068 0.0 0.8 -4.010000 -1.026872 5.323535 3.272000 3.272000 0.0 ... 0.63000 10.21000 10.80000 0.00000 3.300000 0.000098 1870.682140 7.322180 -7.53 7.47000

32 rows × 63 columns

In [97]:
SPOTS_expanded['34'][0.126]
Out[97]:
logAge Mass Fspot Xspot log(L/Lsun) log(R/Rsun) log(g) log(Teff) log(T_hot) log(T_cool) ... H-K G-H G-K G-V A(Li) Lsun Teff M_bol BCv RP-J
0 8.100000 1.300 0.339 0.8 0.412254 0.125899 4.299428 3.801741 3.825969 3.729059 ... 0.053157 1.309567 1.362724 -0.139495 3.276616 2.583771 6334.923139 3.721355 NaN 0.518566
1 8.100000 1.250 0.339 0.8 0.330256 0.105689 4.322815 3.791347 3.815575 3.718665 ... 0.056602 1.389840 1.446442 -0.141702 3.267539 2.139224 6185.104762 3.926349 NaN 0.550429
2 8.100000 1.200 0.339 0.8 0.243977 0.082324 4.351816 3.781460 3.805687 3.708777 ... 0.060524 1.468213 1.528737 -0.142472 3.255346 1.753789 6045.883439 4.142047 NaN 0.581605
3 8.100000 1.150 0.339 0.8 0.153256 0.056658 4.384665 3.771612 3.795840 3.698930 ... 0.063878 1.548645 1.612523 -0.141929 3.239359 1.423167 5910.339933 4.368851 NaN 0.613361
4 8.100000 1.100 0.339 0.8 0.058102 0.029655 4.419364 3.761325 3.785553 3.688643 ... 0.068538 1.633607 1.702145 -0.137937 3.219617 1.143146 5771.983488 4.606736 NaN 0.647096
5 8.100000 1.050 0.339 0.8 -0.041363 0.001673 4.455125 3.750450 3.774677 3.677767 ... 0.073601 1.725300 1.798901 -0.133883 3.194028 0.909154 5629.242268 4.855397 NaN 0.683571
6 8.100000 1.000 0.339 0.8 -0.144951 -0.026781 4.490844 3.738780 3.763008 3.666098 ... 0.078869 1.831826 1.910695 -0.147280 3.159421 0.716224 5479.993836 5.114368 NaN 0.726261
7 8.100000 0.950 0.339 0.8 -0.252749 -0.054619 4.524244 3.725750 3.749977 3.653067 ... 0.086146 1.949262 2.035408 -0.159072 3.110233 0.558793 5318.017351 5.383863 NaN 0.775437
8 8.100000 0.900 0.339 0.8 -0.364868 -0.081453 4.554431 3.711137 3.735364 3.638454 ... 0.097240 2.076463 2.173704 -0.159854 3.039105 0.431650 5142.056686 5.664161 NaN 0.833022
9 8.100000 0.850 0.339 0.8 -0.481992 -0.107274 4.581249 3.694766 3.718994 3.622084 ... 0.114929 2.201761 2.316690 -0.163635 2.929287 0.329615 4951.834257 5.956971 NaN 0.896213
10 8.100000 0.800 0.339 0.8 -0.605662 -0.132469 4.605310 3.676446 3.700674 3.603764 ... 0.134222 2.333238 2.467459 -0.192590 2.756017 0.247935 4747.295001 6.266145 NaN 0.966511
11 8.100000 0.750 0.339 0.8 -0.736951 -0.157424 4.627192 3.656102 3.680329 3.583419 ... 0.155998 2.480021 2.636019 -0.230109 2.463906 0.183252 4530.035861 6.594368 NaN 1.052385
12 8.100000 0.700 0.339 0.8 -0.876848 -0.181250 4.644880 3.633040 3.657268 3.560358 ... 0.172535 2.676434 2.848968 -0.299951 1.935785 0.132786 4295.761882 6.944110 NaN 1.168863
13 8.100000 0.650 0.339 0.8 -1.031144 -0.210744 4.671684 3.609213 3.633441 3.536531 ... 0.188190 2.878926 3.067116 -0.360417 0.878639 0.093080 4066.430555 7.329850 NaN 1.295745
14 8.100000 0.600 0.339 0.8 -1.153239 -0.239203 4.693838 3.592919 3.617146 3.520236 ... 0.201647 3.007821 3.209468 -0.431123 -1.097940 0.070269 3916.686310 7.635088 NaN 1.384030
15 8.100000 0.550 0.339 0.8 -1.270122 -0.264206 4.706057 3.576200 3.600427 3.503517 ... 0.218399 3.138821 3.357220 -0.474141 -inf 0.053688 3768.772046 7.927295 NaN 1.479751
16 8.100000 0.500 0.339 0.8 -1.440761 -0.304085 4.744422 3.553480 3.577707 3.480797 ... 0.240962 3.339630 3.580592 -0.606917 -inf 0.036244 3576.675831 8.353893 NaN 1.632056
17 8.100000 0.450 0.339 0.8 -1.598062 -0.348402 4.787298 3.536313 3.560540 3.463630 ... 0.253016 3.511515 3.764531 -0.716838 -inf 0.025231 3438.053813 8.747145 NaN 1.762608
18 8.100000 0.400 0.339 0.8 -1.732767 -0.389883 4.819107 3.523377 3.547604 3.450694 ... 0.259253 3.647991 3.907245 -0.775352 -inf 0.018503 3337.158468 9.083908 NaN 1.867995
19 8.100000 0.350 0.339 0.8 -1.855306 -0.429144 4.839638 3.512373 3.536600 3.439690 ... 0.263619 3.765830 4.029448 -0.853239 -inf 0.013954 3253.664509 9.390254 NaN 1.960479
20 8.100000 0.300 0.339 0.8 -1.970007 -0.470971 4.856346 3.504611 3.528839 3.431929 ... 0.266240 3.850802 4.117042 -0.921175 -inf 0.010715 3196.032449 9.677009 NaN 2.027444
21 8.100000 0.250 0.339 0.8 -2.093052 -0.516734 4.868690 3.496731 3.520959 3.424049 ... 0.268085 3.943995 4.212080 -1.002123 -inf 0.008071 3138.565164 9.984621 NaN 2.101488
22 8.100000 0.200 0.339 0.8 -2.239438 -0.570778 4.879868 3.487157 3.511384 3.414474 ... 0.270133 4.045065 4.315199 -1.144710 -inf 0.005762 3070.130315 10.350584 NaN 2.179020
23 8.100000 0.150 0.339 0.8 -2.429194 -0.639035 4.891443 3.473846 3.498074 3.401164 ... 0.273108 4.146379 4.419486 -1.452944 -inf 0.003722 2977.461880 10.824976 NaN 2.248586
24 8.100000 0.100 0.339 0.8 -2.712418 -0.730690 4.898662 3.448868 3.473095 3.376185 ... 0.279062 4.334799 4.613860 -2.225280 -inf 0.001939 2811.043719 11.533036 NaN 2.375223
26 8.100371 0.090 0.340 0.8 -2.980000 -0.863279 5.118083 3.449000 3.449000 2.759200 ... 0.352000 4.375000 4.730000 -2.370000 -0.700000 0.001047 2811.900830 6.913199 -4.13 2.340000
27 8.100371 0.085 0.340 0.8 -3.100000 -0.899629 5.165960 3.438000 3.438000 2.750400 ... 0.360000 4.539000 4.900000 -2.700000 2.687390 0.000794 2741.574172 7.004074 -4.62 2.450000
29 8.100371 0.080 0.340 0.8 -3.240000 -0.935542 5.211456 3.420000 3.420000 2.736000 ... 0.422000 4.780000 5.200000 -3.150000 3.254725 0.000575 2630.267992 7.093855 -5.32 2.580000
31 8.100371 0.077 0.340 0.8 -3.470000 -0.982967 5.289706 3.384000 3.384000 2.707200 ... 0.465000 5.340000 5.810000 -3.090000 3.298695 0.000339 2421.029047 7.212417 -5.78 3.060000
34 8.100371 0.074 0.340 0.8 -3.600000 -0.991400 5.289313 3.356000 3.356000 2.684800 ... 0.510000 5.550000 6.000000 -3.450000 3.300000 0.000251 2269.864852 7.233500 -6.25 3.110000
38 8.100371 0.068 0.340 0.8 -4.010000 -1.026872 5.323535 3.272000 3.272000 2.617600 ... 0.630000 10.210000 10.800000 0.000000 3.300000 0.000098 1870.682140 7.322180 -7.53 7.470000

31 rows × 63 columns

In [98]:
SPOTS_edr3_full['00'].keys()
Out[98]:
dict_keys([0.004, 0.005, 0.006, 0.007, 0.008, 0.009, 0.01, 0.02, 0.028, 0.04, 0.05, 0.063, 0.071, 0.079, 0.089, 0.1, 0.126, 0.158, 0.2, 0.316, 0.398, 0.501, 0.631, 0.708, 0.794, 0.891, 1.0, 1.995, 3.162, 3.981])

Isochrones plots¶

In [99]:
plt.rcParams.update({'font.size': 14, 'axes.linewidth': 1, 'axes.edgecolor': 'k'})
plt.rcParams['font.family'] = 'serif'

Isochrones in HRD (interior) and CMD (atmosphere)

In [100]:
from models_test import Isochrones
In [101]:
bands1 = [['G_abs', 'RP_abs'], ['G_abs', 'J_abs'], ['J_abs', 'K_abs'], ['G_abs', 'y_abs'], ['G_abs', 'z_abs']]
bands2 = [['G_i00', 'G_RP_i00'], ['G_i00', 'J_i00'], ['J_i00', 'Ks_i00'], ['G_i00', 'yP1_i00'], ['G_i00', 'zP1_i00']]
bandsobs = [['G', 'RP'], ['G', 'J'], ['J', 'K'], ['G', 'y'], ['G', 'z']]

isochrones = [0.02, 0.08, 0.12, 0.6]

isochrones_grid = Isochrones(
    BTSettl_Li_isochrones,
    PARSEC_iso_omega_00_Phot_dict,
    bands1,
    bands2,
    'BT-Settl $\odot$',
    r'PARSEC $\omega_i=0.0$; $Z=0.001547$',
    isochrones,
    filename='model_comparison',
    data_obs=data_obs_Pleiades,
    obs=True,
    bandsobs=bandsobs,
    dpi=350
)

%matplotlib inline
isochrones_grid.plot_isochrones_grid()
Saved figure as model_comparison_BT-Settl_PARSEC.pdf
No description has been provided for this image
In [102]:
%matplotlib inline
isochrones_grid.plot_single_column(['BP_abs', 'RP_abs', 'G_abs'], ['G_BP_i00', 'G_RP_i00', 'G_i00'], ['BP', 'RP', 'G'])
Saved figure as model_comparison_BT-Settl_PARSEC.pdf
No description has been provided for this image
In [ ]:
 
In [ ]:
 
In [ ]: